Re: rand() function
| From: | David VanHorn | Date: | Fri, 07 Jul 2000 00:36:28 +0000 |
| Subject: | Re: rand() function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5292@lists.php.net to get a copy of this message | ||
Shouldn't you seed the random generator?
Here's what I use to generate random cookies. So far, they look pretty daggone random.
srand(date("s"));
$possible="1234567890ABCDEF";
$Cvalue="";
while(strlen($Cvalue)<10) {$Cvalue.=substr($possible,(rand()%(strlen($possible))),1);}
--
www.SpamWhack.com A pre-emptive strike against spam
A tornado is a lady whose skirts you do NOT want to look up!
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9