Random Cool Links

Here is your randomly chosen link:

Click here to get another random link.

How to Add Your Web Page

If you have a cool web page that you think others will enjoy, then you may add it to our list. Please only add links that are truly fun. Here's how to add your link:

Step #1 - create a link on your page that points to this page. Just cut and paste the HTML code below into your web page. Make sure you enter this as raw HTML code and not as formatted text.

<a href="http://www.softsynth.com?addme=yes">Random Cool Links</a>

Make sure the link is somewhere that people will click on it because frequent click-throughs will help you stay on the list.

Step #2 - someone clicks on the link on your page and comes to this page. At that moment your page will automatically be added to our list.

How it Works

A PHP script is used to generate this page. The PHP code randomly selects a link from an ever changing list at "http://www.softsynth.com/fun/links.txt".

Here is the PHP code that picks a random link:

    $randKey = array_rand( $linkArray ); // get random index
    $randomLink = $linkArray[ $randKey ]; // use index to get random link

When someone comes to this page by clicking on your link, the $_SERVER["HTTP_REFERER"] variable is set to your URL. I examine the URL to make sure it is not an email link and that it contains the "addme" request. If the URL is not currently in the list then it is added to the list. If there are already 20 or more links then one old link is randomly chosen to be replaced by the new link. So your link may get bumped off the list. But as soon as someone clicks through your page you get added back on. So the list reflects recent click-throughs. Thus dead pages get culled and never reappear. Active pages get added back quickly and spend more time on the list.

Note that if I pick a random link that is the same as the refering page then I pick another link. So you will only rarely see the refering page as the random link.

Also note that I strip off the query and target part of the URL so try to link from a regular page.

By the way, PHP is a very nice language for writing web server scripts. Read more about it here.

© 1997-2007 Mobileer Inc All Rights Reserved