Thread: php help
View Single Post
Old 2005-03-19, 01:47 PM   #23
amber438
Whatever don't kill ya makes ya stronger...
 
amber438's Avatar
 
Join Date: Apr 2003
Location: New York
Posts: 820
Send a message via ICQ to amber438
Quote:
Originally Posted by Useless Warrior
Place this PHP statement on your page where you want your adverstising to appear:

<?php
$file = "bannerlist.txt";
$banners = file($file);
srand((float) microtime() * 1235689);
$selected = array_rand($banners);
$SelBanner = trim($banners[$selected]);
if ($SelBanner=="") {
$SelBanner = trim($banners[0]);
};
echo $SelBanner;
?>

You'll notice that it pulls it's info from a file called bannerlist.txt. So make a text document with that name and upload it to the same directory as the page with the PHP code above. Put each separate banner, text link, or whatever on its own line. It can pull in entire tables, just make sure you get rid of any carriage returns so that the entire table is on one line on bannerlist.txt.
If I wanted to use this to rotate just maybe 3-4 ads without using another phpads call, could it be used on shtml?
__________________
Red Hot Links
Red Hot Galleries
amber438 is offline   Reply With Quote