php microtime() function I get a "undeclared function" error when trying to call the microtime() function in a php script... does this mean it is not installed or enabled on my server? How do I or my server admin install it?
thanks...
here's the code :
<?php function CreatePassword () { $String = "This is the text which will be encrypted so that we may create random and secure passwords!"; $Length = 8; // Change this value to indicate how long your passwords should be. 32 character limit. $String = md5($String); $StringLength = strlen($String); srand ((double) mircotime() * 1000000); $Begin = rand(0,($StringLength-$Length-1)); // pick an arbitrary starting point $Password = substr($String, $Begin, $Length); print ("Your recommended password is:<p><big>$Password<big>\n"); } // End of the CreatePassword function. ?> <html> <head> <title>Password Generator within a function</title> </head> <body> <?php CreatePassword(); // Call the function ?> </body> </html>
according to your code you posted, you have
mircotime()
it should be
microtime() //notice the c and r are transposed in your code
that is why you can't use the function, PHP thinks you created a function and are trying to call it
I'm a dumbass!!!
thanks
I need sleep!!!
Originally posted by Mr. Mojo Risin I'm a dumbass!!! thanks I need sleep!!!
no problem, it happens to most people when they have been looking at the same thing for hours, your eyes get kinda crossed and everything looks the same
a fresh set of eyes usually will spot those errors right off