RE: rand function problem - pl. help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Abhishek,
It could be to do with the version of PHP you are running or platform.  The
function documentation says:

Note: On some platforms (such as Windows) RAND_MAX is only 32768. If you
require a range larger than 32768, specifying min and max will allow you to
create a range larger than RAND_MAX, or consider using mt_rand() instead. 

Note: As of PHP 4.2.0, there is no need to seed the random number generator
with srand() or mt_srand() as this is now done automatically. 

See more information at:

http://uk.php.net/manual/en/function.rand.php 

Hope that helps.

Brian

-----Original Message-----
From: abhishek jain [mailto:ejaincom@xxxxxxxxx] 
Sent: 01 February 2006 16:58
To: php mailing list; in-phpug
Subject:  rand function problem - pl. help

Dear Friends,
I have the following code in mine prog to generate random text.
$password =
md5(uniqid(rand(1000000000,9999999999))).time();

But when i execute the code on mine server following errors appear,
Warning: rand(): Invalid range: 1000000000..-1 in <filename>

The same works well on mine local PC.
Pl. tell me what configuration must i change to correct this problem.
--
Thanks and kind regards,
Abhishek jain

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links



 



PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux