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 Link to comment https://forums.phpfreaks.com/topic/240682-why-isnt-this-displaying/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.