Simple PHP Banner script

Ok so I had sold some banners [look up!] and needed a way to roate them in a random form. Well my solution is quite simple and if you are needing something to do the same thing below is the script for you! ๐Ÿ™‚

<?php
$bannerAd[1] = 'code for ad 1';
$bannerAd[2] = 'code for ad 2';
$bannerAd[3] = 'code for ad 3';
$bannerAd[4] = 'code for ad 4';
$bannerAd[5] = 'code for ad 5';

$adCount = count($bannerAd);
$randomAdNumber = mt_rand(1, $adCount);
echo $bannerAd[$randomAdNumber];
?>

Now for its use. Place the EXACT code be it flash or image or text inside one of the ” tags. If you dont need all 5 then remove the lines you dont need. If you do need more than 5 then just add more with the next number [6 7 8 9…so on and so forth]

Thats as simple as it gets. Just place that code on your PHP ENABLED site and it will be all good ๐Ÿ™‚

  • DONT FORGET THIS REQUIRES PHP!!!!!!!

-Tracker

One thought on “Simple PHP Banner script”

Leave a Reply

Your email address will not be published. Required fields are marked *