Code: Select all
<?php
//bnr.php
$banners = file("banners.lst");
header("Location: " . $banners[rand(0,sizeof($banners))]);
?>Code: Select all
<IMG SRC="bnr.php" WIDTH="468" HEIGHT="60" ALT="random banner">Moderator: General Moderators
Code: Select all
<?php
//bnr.php
$banners = file("banners.lst");
header("Location: " . $banners[rand(0,sizeof($banners))]);
?>Code: Select all
<IMG SRC="bnr.php" WIDTH="468" HEIGHT="60" ALT="random banner">Code: Select all
<?php
$tmp=0;
// Get Image
$fp = fopen ("banners.lst","r");
while ($data = fgetcsv ($fp, 2000, "|")) {
if ($data[0]) {
$Img[$tmp] = trim($data[0]);
$tmp++;
}
}
fclose ($fp);
$count = $tmp-1;
srand((double) microtime() * 1000000);
$loopcount=0;
while(!$Img[$Pull] && $loopcount < 100) {
$Pull = rand(0,$count);
$loopcount++;
}
// Display Image
if ($Img[$Pull]) {
echo "<a href='whatever.php'><img src='$Img[$Pull]' border=0></a>";
} else {
echo "<a href='whatever.php'>Link Name</a>";
}
?>