Banner Rotator
This is a php rotator and you can add unlimted amount of banners!
Simply make a txt file, and name "banners.txt". Nice and Easy!
In the text file list the domain, and add link,
example:
http://damind.com,http://damind.com/banners/test.gif
http://daforums.com,http://daforums.com/banners/banner.gif
and So on!
Now this is your banner .php , this is the coding to rotate the banners!
<?
srand((double)microtime()*1000000);
function banner($select, $host, $host2)
{
$eattempted = true;
$lines = file("banners.txt");
$count = count($lines);
$random = rand(0,$count-1);
$selected = $lines[$random];
$pieces = explode(",", $selected);
IF ($host == $pieces[0] OR $host2 == $pieces[0])
{
banner ("display", $host, $host2);
}
ELSE
{
echo ("<center><A HREF=\"$pieces[0]\"><IMG SRC=\"$pieces[1]\" BORDER=0></A></center>");
}
}
$host = "http://" . $HTTP_HOST;
$host2 = str_replace("www.","",$host);
IF (!isset($attempted))
{
banner ("display", $host, $host2);
}
?>
Now upload both the banners.txt and banners.php and command the banners.txt to 777!
We command the file so we can open and read the file.