GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   'lil PHP help. (https://gfy.com/showthread.php?t=126708)

- Jesus Christ - 04-20-2003 02:17 AM

'lil PHP help.
 
Will this work...and is there a way to make the code cleaner/faster? Its going to be processed like a couple times a second.

Any input appreciated (cuz IM no programmer)
Its supposed to redirect but I don't even know if my header line is right.

PHP Code:

<?php
// Random URL From File
srand((double)microtime()*1000000);
$list=file("URLLIST.txt");
$url=rand(0count($list)-1);
header("Location: $url");
?>


Damian_Maxcash 04-20-2003 03:38 AM

Heres a little script I use..... works like a dream

randomurl.zip

cj-design 04-20-2003 07:39 AM

Quote:

Originally posted by - Jesus Christ -
[B]Will this work...and is there a way to make the code cleaner/faster? Its going to be processed like a couple times a second...
It will work, but not sure what srand does in your script! :thumbsup

jollyperv 04-20-2003 07:51 AM

Jesus Christ should know the answer.

OzKaNoz 04-20-2003 10:02 AM

Quote:

Originally posted by jollyperv
Jesus Christ should know the answer.
Damn you, that was what I was going to say.
:1orglaugh :winkwink:

Oz

tical 04-20-2003 12:30 PM

Quote:

Originally posted by cj-design


It will work, but not sure what srand does in your script! :thumbsup

That seeds the random number generator... for a 'truly random' number :)


All times are GMT -7. The time now is 08:32 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123