Tom's Newbie Booster

Page Chainer Script
Dynamically create links between pages

Freeware
Version 1.0



Description

This is a script which I created for a TNB poster, but which I'm sure will come in handy for other people here. It's a script (web program) which is for use with a series of single webpages. It acts as a way to link them together.

Imagine that you have say seven webpages with full page ads on them. They are all in the same folder and you'd like to link page 1 to page 2, page 2 to page 3 and so on. This could be done by adding in links to the base of those pages yourself. But what happens if you add in more webpages later on? You would have to open up the last page and create a link to one of the new pages you'd uploaded - as well as adding links at the bottom of the new pages to the next one in the sequence.

This script aims to solve that problem. The script lives in the same folder as the webpages. The same link is included on the base of every page and the script does the following:

- Checks which page the surfer came in on.
- Finds out what the next page in the sequence should be.
- Checks to make sure that page actually exists.
- Serves up either the next page or, in the case that the next page does not exist, loops back to the first page in the sequence.


Working Example

Here is an example of the script in action. As usual, you'll need to use your imagination and pretend that each page you see is a full page ad (or other webpage).

http://www.tomsnewbiebooster.com/resources/page-chainer/001.html

Hey - I said you'd have to use your imagination! :-) It's a pretty boring page. But look at the base of the page. Click on the next link. You should get an equally dull page but it should be 002.html. Keep clicking until you get to 007.html and then click the next link one last time. At this point, the script realizes that there are no more pages to show the surfer, and it should then loop back to the first page in the sequence.

If you were to upload another 7 pages, it would get to 014.html and then loop back to 001.html.


Download & Installation

This is actually very straight forward - should take a matter of minutes to get up and running on your webspace.

1) Download the zip file:
page-chainer.zip

2) Unzip the chain.php file somewhere.

3) Upload chain.php to the folder where your 001.html, 002.html etc... pages are.

4) At the base of each page, add the following code:

<A href=chain.php?page=<!--#echo var="DOCUMENT_NAME" -->><FONT FACE="Arial black, Helvetica" SIZE=4>NEXT PAGE - CLICK HERE</FONT></A>

Don't be scared to change the HTML to get the font size you'd like. If you mess it up, paste the code in and start again. I've highlighted the link text in GREEN, and the font tag in RED in the example above.


Enter Tom's Newbie Booster here
More tips, scripts and help...