Articles: 843 | Categories: 148   
   
   
Home Articles Contact Us
 
 
 
 
Rotating Banners (0 Comments)
Admin: Posted Date: March 3, 2010

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);

?>

 

 
 
Add a Comment:
 
(You must be signed in to comment on an article. Not a member? Click here to register)
   
Title:

Comments: