This tutorial will show you how to create a
rotating banner for advertisers. Its a great way to earn income from
your website and get more visitors.
Things to do-
set $File and $Images to the paths to the images.
Crate the $Stat file(blank .txt file).
| CODE |
$File = 'stat.txt';
$Images[] = 'Banner1.gif';
$Images[] = 'Banner2.gif';
$Images[] = 'Banner3.gif';
$fp = fopen($File, 'r');
$Stat = fread($fp, filesize($File));
fclose($fp);
if($Stat >= count($Images)) $Stat = 0;
echo $Images[$Stat];
$Stat++;
$fp = fopen($File, 'w');
fwrite($fp, $Stat);
fclose($fp);
?> |
|