sphinx Posted June 29, 2011 Share Posted June 29, 2011 Hello, I want php to display a random combination of numbers in the text box, im trying: <?php function createRandomPassword() { $chars = "abcdefghijkmnopqrstuvwxyz023456789"; srand((double)microtime()*1000000); $i = 0; $pass = '' ; while ($i <= 5) { $num = rand() % 33; $tmp = substr($chars, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } $password = createRandomPassword(); echo '<input style="border: 1px solid #0000FF;" type="text" name="tag" size="15" value='.$password.' />'; ?> But the value field output is blank, what am i doing wrong/ Thanks Quote Link to comment https://forums.phpfreaks.com/topic/240682-why-isnt-this-displaying/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.