On Thu, 20 Dec 2001, Necro wrote:

> Lo all,
>
> Can anyone please explain why this doesn't work...
>
> $floor = 100000;
>               $ceiling = 999999;
>               srand((double)microtime()*1000000);
>               $random = rand($floor, $ceiling);
>
> I get the error...
> Warning: rand(): Invalid range: 100000..999999 in
> d:\htdocs\ezone\web\signup2.php on line 49
>
> Thankyou
>
> Andrew

Hi there.

I see you  use windows, but when I looked up 'microtime' in
the manual it says the following :

-------
microtime

microtime -- Return current UNIX timestamp with microseconds

Description

string microtime(void);

Returns the string "msec sec" where sec is the current time measured in the
number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and
msec is the microseconds part. This function is only available on operating
systems that support the gettimeofday() system call.

See also time().
-------

So you'll probably have to use something else for your rand (or change OS ;) )

Good luck, and a merry Christmas to you.

-- 
Knut
------
Knut H. Hassel Nielsen, [EMAIL PROTECTED]
Principal Engineer, Office : ITS 204
IDI NTNU, Sem Saelands vei 7-9
N-7491 Trondheim, Norway
Phone (+47) 73 59 18 46 Fax (+47) 73 59 60 35

"Programmers don't die, they just GOSUB without RETURN."


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to