hi i need to create some passwords but i have a get varible in a function and its not doing it here is full code if u can help me dat would be great!
<? session_start();
$get=$_REQUEST['length'];
$on="on";
function password(){
if($_REQUEST['alpha']==$on){
$alpha="abcdefghijklmnopqrstuvwxyz";
}
if($_REQUEST['numeric']==$on){
$numeric="0123456789";
}
// start with a blank password
$password = "";
// define possible characters
$possible = "$numeric$alpha";
// set up a counter
$i = 0;
// add random characters to $password until $length is reached
while ($i < $_REQUEST['length']) {
// pick a random character from the possible ones
$char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
// we don't want this character if it's already in the password
if (!strstr($password, $char)) {
$password .= $char;
$i++;
}
}
// done!
echo"$password";
}password();
echo"<br/><br/>$get"
?>