Código PHP:
<?
$f=fopen("3banners.dat","r");
$numero=0;
$banners[0]="";
while(!feof($f))
{
$banners[$numero]=fgets($f,500);
$numero++;
}
fclose($f);
$f=fopen("3banner.dat","r");
$num=fread($f,filesize("3banner.dat"));
echo"<BR>$banners[$num]";
if($num==$numero-1)
$num=0;
else
$num++;
fclose($f);
$f=fopen("3banner.dat","w");
fwrite($f,$num,strlen($num));
fclose($f);
?>