> function auth_user($logged_in) {
> if (isset($logged_in)) {
> list($s_username, $hash) = explode(',',$logged_in);
> global $secret_word;
> if (md5($s_username.$secret_word) == $hash) {
> $username = $s_username;
> return $username;
> } else {
> die ("You have tampered with your session.");
> }
> } else {
> die ("Sorry, you are not logged in. Please log in and try again.");
> }
> }
> auth_user($_SESSION['login']);
> var_dump($username);
$username = auth_user($_SESSION['login']); will actually assign the returned
value to the variable $username. The $username variable in your function
does not have global scope and only exist in the function.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php