Quote:
Originally posted by Lenny2
I need a little php or cgi type script that will pull random galleries from a text file for a TGP.
|
This won't pull them from a text file, but will work great for a random page.. I dunno if it'll help.
-------------------------
<?php
$url[0]='http://www.somesite.com/urla.html';
$url[1]='http://www.somesite.com/urlb.html';
srand((double)microtime()*1234567);
$turl=$url[intval(rand(0,1))];
header("location: $turl");
?>
------------------------
or
------------------------
<?php
$url[0]='http://www.somesite.com/urla.html';
$url[1]='http://www.somesite.com/urlb.html';
$url[2]='http://www.somesite.com/urlc.html';
srand((double)microtime()*1234567);
$turl=$url[intval(rand(0,2))];
header("location: $turl");
?>
-------------------------
Notice the variable difference (0,2) or (0,3).. you can use as many variables as you like. Now just name it /somepage.php and use that for your link
AST