PHP BANNER ROTATION
Created by: Andrew Wirtanen
Last Modified: January 16, 2004
Click here to download
-------------------------------------------------------------------------------------------

DESCRIPTION:
This program is for people who are seeking a banner rotation program and have PHP, but not mySQL. It uses an external config file and any number of .txt files for inclusion. The program rotates banners based on a percentage specified in decimal format in the config file.

-------------------------------------------------------------------------------------------

INSTALLATION:

-------------------------------------------------------------------------------------------

- index.php
You can rename this file whatever you want, but make sure it has a .php extension.

The only three lines you should need to modify in the PHP file are:
$vFile="bannerads/bannerads.config
$vBanners="bannerads/banner
$vBannersExt=".txt";

You DO NOT need to modify these lines if you are going to store your files in a folder named "bannerads" and you name the files "banner0.txt","banner1.txt",etc.

-------------------------------------------------------------------------------------------

- bannerads.config
You need to edit this file. Row 1 corresponds to banner 0, row 2 to banner 1, etc. So, if you have two banners, you need two lines, and you cannot have more than two lines.

The first value in each row is the count of banner displays. You should start one row with 1 banner display entry (or more if you want) because PHP will give an error if it has to divide by 0.

The second value (after the comma) is the percentage in decimal format that you want the banner to be displayed. .5 corresponds to 50%, .2 to 20%, etc.

Example bannerads.config with two banners that each display 50% of the time:
1,0.5
1,0.5

-------------------------------------------------------------------------------------------

- banner0.txt -> banner1.txt
You need to create these files, for as many banner ads that you have. Each file should have the HTML code (or whatever) that you are using to display the banner. You can put whatever you want in these files, theoretically.

-------------------------------------------------------------------------------------------

Files included:
bannerads.config
banner0.txt
banner1.txt
index.php

Example of Banner (refresh the browser and it should change):
Indulged.com