> Random Ad
File Size: 3
Ad Rotator Random Ad is a simple PHP ad rotator. It
reads a file which contain the ads' HTML code on your
site and pick one randomly. You can put as many ads
as you like into the file. To use it, just include a
small piece of HTML code in your pages!
The package consists
of 3 files: randomad.php, ads.txt, sample.html.
To run a quick
you can put all of the
above files in the same directory on your server. Then
visit the file sample.html. Try to reload the sample.html
page a few time. You should see different ads appears
To make it work
for your own site:
1) upload the files:
randomad.php and ads.txt to your server.
2) put your ads' HTML
code into the file "ads.txt". Each line per
3) copy and paste the
following code (as in sample.html) into your web pages:
scrolling="no" frameborder=0 src="randomad.php">
- you may need to adjust the size of the iframe to
fit your own use. (Tips:
you can set the size to the largest one of your ads.
and put a <center> </center> tag around
each ads in the ads.txt file)
- if you put the randomad.php
in different directory, please adjust the "src="
- Do you have a link to a demo available? This page
(the banner space at the top) is using Random Ad.
- Does it support both text and graphics? It should
support any kind of ads. What you put into "ads.txt"
are HTML code for your ads, you can put whatever you
like in the HTML code.
- Do all the banners have to be the same size? No.
You can set the iframe (on your html page) size to
a larger size than your ads, so all your ads will
fit. Please refer to the Tips
- Does it support the side tower banners? Yup, you
can adjust the iframe size to fit your banners.
- Can I use the code on two areas of the website,
like 1 on the left column, and 1 on the right? To
use it for two areas, you need to make some modifications:
1) make a copy of randomad.php and rename it (say,
"randomad2.php"). 2) create a text file,
say, "ads2.txt" to hold your other batch
of ads. 3) modify the php file (randomad2.php) you
just created, so it read the ad content from the new
text file (ads2.txt). i.e. change the line: $adfile
= "ads.txt" to $adfile = "ads2.txt".
Put the php and txt files on your server and put the
corresponding iframe (the src parameter to point to
the new php file) on you html pages.