Jump to content

Why isn't this displaying


sphinx

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.