Hi
You're almost there with this - the thing to do is pass the return value of the function to a variable accessible outside the function. Function variables, otherwise called local variables, are never accessible from outside the function. Conversely, external (global) variables are not external from within a function unless declared as global within each function that needs to access them.
To cover all bases, then, add the following line at the start of your script -
$password='';
and within both of your two functions (you've already done this for generatePassword() - add
global $password;
I notice, though, you commented out the
//return $password
line of
generatePassword().
Any particular reason for not using
$password=generatePassword()
? That way, what you wanted would have been generated in the local scope without the need for referencing the global.
Cheers, A