Thread: php Ad Rotator
View Single Post
Old 2007-11-26, 09:47 AM   #1
Licker4U
Mean people suck, nice people swallow, are you mean or nice?
 
Licker4U's Avatar
 
Join Date: Sep 2003
Location: Lower Alabama-The Redneck Riviera
Posts: 2,377
Send a message via ICQ to Licker4U Send a message via AIM to Licker4U
php Ad Rotator

I've been using this ad rotator script for 6 months and it worked fine. Now I notice the ads don't appear at all. Any ideas why it would just quit all of a sudden?

<?php



// TEST MODE - SET TO on OR off
$test_mode = "off";



// RESET ADS
$ads = "";

// AND PICK AN AD

// COUNT ADS

$dirhandle = opendir("ads/");
while($filename = readdir($dirhandle)) {
if (ereg ("htm", $filename)) {
$ads[]=$filename;
}
}
closedir($dirhandle);

$number_of_ads = count($ads);

if($test_mode == "on") {
print("There are <B>$number_of_ads</B> ads in the ads folder<BR>");
}

// SET THE RANDOM SEED
mt_srand(doubleval(microtime()) * 100000000);

// PICK A RANDOM NUMBER
$random_number = mt_rand(1, $number_of_ads);

if($test_mode == "on") {
print("I am going to show advert <B>$random_number</B> of <B>$number_of_ads</B><BR><BR>");
}

$array_number = $random_number -1;

include("ads/$ads[$array_number]");

?>
__________________
Submit to Girls That Squirt , Hairy Pussy Links and Best Wet Pussy
Licker4U is offline   Reply With Quote