I set a SESSION inside a function and I'm trying to accses it from another function. I think that the session is set only for that function, can i do anything about it?
thx!
the code:
$admin_password = sha1(md5('1234')); // סיסמת מנהל
function login($password,$admin_password) {
$password = sha1(md5($password));
if ($password == $admin_password) {
$_SESSION['admin_ver'] = $admin_password;
return true;
} else {
return false;
}
}
function log1($admin_password) {
if (isset($_SESSION['admin_ver'])) {
if ($_SESSION['admin_ver'] == $admin_password) {
return true;
} else {
return false;
}
} else {
return false;
}
}
EDIT: I tried to run this page on another server and it worked. Can anyone suggest the reason? thx again!
session_start()on top of the pagefunction loginis called first ?// סיסמת מנהלso anyone interested in knowing what does it mean, it means "// Password Manager"