The Worlds Simplest Banner Rotator Script (?)

Do you want to have a small banner rotator-script? You want it up and running fast and you do not want to use databases for something as simple as a banner rotator-script? Here is a free script that will rotate your banners, you could not find any more simple banner rotator script than this:

PHP-Code:

srand ((double)microtime()*1000000);
$f_contents = file ("banners.txt");
$line = $f_contents[array_rand ($f_contents)];
print $line;

So what does it do? It does open the textfile “banners.txt” which should be placed in the same folder as the php-file.
It then takes one random line from the textfile and displays it at your website.

So inside the banners.txt-file you should have small bits of HTML. One banner on each line like this:

<a href=”http://www.sponsor1.com”><img src=”banner1.gif”></a>
<a href=”http://www.sponsor222.com”><img src=”banner222.gif”></a>
<a href=”http://www.coolsite3.com”><img src=”coolestbanner.gif”></a>

Thats it! You can add how many lines of banners as you want in the textfile.