Here's a follow-up to what you'll need to do if including everything in the header template (a little extra code req'd)...
Example (displaying 3 images from a pool of 3 possible):
<? //UBBTREMARK
$image_html = array();
// Insert the HTML code below for each image or banner in the pool (don't forget the \ before the ")
// You can also add individual ALT and TITLE tags if you wish
$image_html[0] = "<a href="http://www.example1.com"><img src="images/1.gif" border="0"></a>";
$image_html[1] = "<a href="http://www.example2.com"><img src="images/2.jpg" border="0"></a>";
$image_html[2] = "<a href="http://www.example3.com"><img src="images/3.png" border="0"></a>";
// Configure the number of unique images or banners to be displayed on the page
// It can be any number from 0-6 in the example given
$number_of_images = 3; // <-- Configure
$random = array_rand($image_html, $number_of_images);
[:"red"]$image1 = $image_html[$random[0]];
$image2 = $image_html[$random[1]];
$image3 = $image_html[$random[2]];[/]
echo <<<UBBTPRINT
<!-- START OF header.tmpl TEMPLATE -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="{$ubbt_lang['READ_DIRECTION']}">
<head>
$headerinsert
$refresh
<meta http-equiv="Content-Type" content="text/html; charset={$ubbt_lang['CHARSET']}" />
<link rel="stylesheet" href="$stylesheet" type="text/css" />
<link rel="shortcut icon" href="{$config['images']}/loonyicon.ico" />
$javascript
<title>{$config['title']}: $inputTitle</title>
</head>
<body>
[:"red"]<center>
$image1
$image2
$image3
</center> [/]
<!-- END OF header.tmpl TEMPLATE -->
UBBTPRINT
/* UBBTREMARK */ ?>
Now notice the parts in red.
The first red section is *new code* you'll need, which converts the randomized array into single variables. It's pretty straight-forward.
The second red section is what will actually display the images now with the variables we just created above.
I think it's pretty easy to understand eh? That will now absolutely make everything work using this method!