View Single Post
Old 11-25-2004, 03:32 PM  
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Create a PHP file named "urls.php" with the URL's sorted each on its own line. IE:
Quote:
www.url1.com
www.url2.com
www.url3.com
www.url4.com

Then create a PHP file named random.php with the following contents:

PHP Code:
<?PHP

$lines 
file("urls.php");
$total count($lines);

srand(time());
$random = (rand()%$total);
echo 
$lines[$random];

?>

Usage:
PHP Code:
<A HREF="random.php">Click here for random link</A

You may contact me via the methods below for my PayPal address
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote