This is a simple AD rotator which picks ads randomly from any ads you place on the banner_ads.txt file (you can rename the file to whatever you want but you must also change the name in the php file if you do this)



Make a file called banner_ads.txt and include this code in it


ANY AD CODE OR TEXT,IMAGES HERE
~
ANY AD CODE OR TEXT,IMAGES HERE
~
ANY AD CODE OR TEXT,IMAGES HERE



You can add how many ads you wish to but remember to separate them with this ~

Now create a file called
ad_rotator.php and add this code to it:

Code: 
<center>
<?php

$fcontents = join ('', file ('banner_ads.txt'));
$s_con = split("~",$fcontents);

$banner_no = rand(0,(count($s_con)-1));
echo $s_con[$banner_no];
?>
</center>
*Note: if you renamed your .txt file to something else make sure you replace "
banner_ads.txt" with what ever file named you used.



The 'ad_rotator.php' can be called in any PHP page where you want the AD to appear. Call it by using include 'ad_rotator.php'; where ever you want the AD to appear.

This pulls ads randomly from the .txt file

TIP: This doesn't have to be used just for ADs, you can use it to call random images,text,quotes,etc Just put what ever you want in the
banner_ads.txt File


Credits:
Code: 
http://www.phpbuddy.com/article.php?id=4
bxflow Reviewed by bxflow on . Simple PHP Ad Rotator This is a simple AD rotator which picks ads randomly from any ads you place on the banner_ads.txt file (you can rename the file to whatever you want but you must also change the name in the php file if you do this) Make a file called banner_ads.txt and include this code in it Rating: 5