![]() |
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 http://bbs.gofuckyourself.net/board/biggrin.gif). 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 http://bbs.gofuckyourself.net/board/smile.gif cheers Lane [This message has been edited by Lane (edited 11-27-2001).] |
|
great lane http://bbs.gofuckyourself.net/board/smile.gif
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 |
All times are GMT -7. The time now is 06:31 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123