I realize there is another ad rotation script out there already, but I feel that this one is a bit more efficient and easier to edit. Plus, this one's in php! Anyway, here it is:
PHP Code:
<?php
//The multidimentional array containing all of the ad info - this is the only place you edit
$ads = array(
// Image Source Hyperlink Destination Alt Text
0 => array('images/ad1.png', 'http://www.yoursite.com', 'My Awesome Site'),
1 => array('images/ad2.png', 'http://www.anothersite.net', 'Another Site') //...so on, so forth
);
//-------------------There's no need to edit anything beneath this point------------------------
//select a random ad from the array
$select = rand(0, count($ads) - 1);
//display the selected ad
echo '<a href="'.$ads[$select][1].'" target="_BLANK"><img src="'.$ads[$select][0].'" title="'.$ads[$select][2].'" /></a>';
?>
I hope it's helpful!