Advertisement Rotator
Here is an easy way to rotate the advertisements on your site.
First off, The code:
<?php
$img = array();
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
$max = count($img) - 1;
$count = rand(0,$max);
echo $img[$count];
?>
$img = array();
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
$max = count($img) - 1;
$count = rand(0,$max);
echo $img[$count];
?>
Now instructions on customizing for your use.
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
$img[] = '<a href="http://www.website.com"><img src="link-image.gif" /></a>';
All you have to do is edit these to what your advertisements are. You can add more advertisements to be rotated by copying and pasting one line of the code.
To display this, Save the file as ads.php and inlcude the page where you want the advertisements to be displayed at
<?php
include('ads.php');
?>
include('ads.php');
?>
Thats about it, Contact me if you are unable to get this to work or if you don't understand a part of the code.

