At the very top of your page, before anything else (including whitespace):
Code:
<?php
error_reporting(E_ALL);
session_start();
$image = array(
array(
'image' => 'imageurl.gif',
'link' => 'http://linktogoto.com'
),
array(
'image' => 'imageurl.png',
'link' => 'http://anotherlinktogoto.com'
),
array(
'image' => 'imageurl.jpg',
'link' => 'http://yetanotherlinktogoto.com'
)
);
if(!isset($_SESSION['curimg']))
$_SESSION['curimg'] = rand(0, count($image) - 1);
$image = $image[$_SESSION['curimg']];
$image = '<a href="' . $image['link'] . '"><img src="' . $image['image'] . '"></a>';
?>
Where you want the image to appear:
Code:
<?php echo($image); ?>
That will keep the banner the same for each user who visits your site, as per djr33's idea.
Bookmarks