Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-01-2006, 10:59 PM   #1
cyber_ninja
Twerk That Ass
 
Industry Role:
Join Date: Jul 2001
Location: Lincoln, California
Posts: 2,197
random url script

does anyone have a random url script?i just need it to grab a random url from a text file
cyber_ninja is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-01-2006, 11:13 PM   #2
mikeyddddd
Viva la vulva!
 
mikeyddddd's Avatar
 
Join Date: Mar 2003
Location: you can't please everyone, so you got to please yourself
Posts: 16,557
PHP?

<?
$urls = file ("random.txt"); //replace with the name of your file
srand(time());
$count = count($urls);
$random = (rand()%$count);
Header("Location: $urls[$random]");
?>

Or replace Header line with:

print("$urls[$random]");
mikeyddddd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-01-2006, 11:14 PM   #3
cyber_ninja
Twerk That Ass
 
Industry Role:
Join Date: Jul 2001
Location: Lincoln, California
Posts: 2,197
thanks
cyber_ninja is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-01-2006, 11:22 PM   #4
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Couldnt get it to one line-

<?$u=file('urls.txt'); echo $u[array_rand(file('urls.txt'))]?>

Or for an instant redirect
<?$u=file('urls.txt'); header('Location:'.$u[array_rand(file('urls.txt'))])?>

Should do the trick
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.