![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Will code for food...
Join Date: Apr 2001
Location: Buckeye, AZ
Posts: 8,496
|
the little random gallery script - here is the code
i see a lot of people asking for this script on the boards.
here is the code for ya: <? mt_srand((float)microtime()*1000000); $f=file("gallery.txt"); $u=trim($f[mt_rand(0,sizeof($f)-1)]); header("Location: $u"); ?> save this file as a php file (no shit ![]() the file format for gallery.txt needs to be one url per line with no empty lines, on a flat txt file. you should upload both files in ascii mode if you are running Windoze. its the least cpu-resource-consuming version that i could think of at this second ![]() cheers Lane [This message has been edited by Lane (edited 11-27-2001).] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Suck it!
Industry Role:
Join Date: Jun 2001
Location: Who wants to know?
Posts: 4,432
|
Hrm
------------------ Make 60% recurring with these Babes! The Webmaster's Folder The Midnight TGP2 Submitter ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
HAL 9000
Industry Role:
Join Date: May 2001
Posts: 34,515
|
great lane
![]() my version is the following <?php $RANDOM_URL_FILE = "pornstars.txt"; srand((double)microtime()*1000000); if (file_exists($RANDOM_URL_FILE)) { $arry = file($RANDOM_URL_FILE); // En: load file. // Fr: charge le fichier. for($i = 0; $i < sizeof($arry) ; $i++) { if (preg_match("/http:/", $arry[$i])) $good_arry[$j++] = chop($arry[$i]); # PHP 4.0 arry_push ($good_arry, $arry[$i]); } if ($good_arry) { header("Location: ".$good_arry[rand(0, sizeof($good_arry) -1)]); } else { echo "error no good URL"; } } else { echo "error: can't open $RANDOM_URL_FILE file"; } ?> i guess your's is better since there's no way i won't have the text file up |
![]() |
![]() ![]() ![]() ![]() ![]() |