Get nutritional information on your favorite Fast Food at

AdLinks Script

Only one script here right now, the AdLink script for rotating textual advertisements/links into HTML documents using SSI. The links are selected at random from a flat text file.

This is an EXTREMELY simple script, but it is perfect for rotating textual ads (for affiliate programs, etc) on your web site.

Here is an example:

Buy CDs at

(Reload this page to see a different ad)

Download AdLinks here.

How it works/Instructions:

AdLinks uses SSI to call a link from a text file (that you create) in your HTML document. It allows you to specify the following: text to appear before the link, the link text, the link URL, text to follow the link, and an HTML "target" for the link (which specifies what browser window to open the link in, e.g. a new window). All you include in your HTML document is <!--#exec cgi="adlinks.cgi"-->. The elements of the link in the text file a separated by the single | character. Here is an example of what how the text file is formatted:
Buy books at|||_blank|the world's largest bookstore.
Buy CDs at||||
Buy Movies at|||_blank|on VHS and DVD.
When the first line is selected it will look like:
Buy books at the world's largest bookstore.
and it will open in a new browser window (because of the "_blank" in the target field).

The only things you will need to change in the script itself are: Then put your links in the text file. The script currently points to sample.txt as the data file, which is included in the zip file, and contains the links above.

Then: Instructions are also included in the script itself.

-Ken Kuhl

Rate this Script @ The CGI Resource Index!
Script Rating:

You can also rate this script at