Hi,
I have been trying to solve the problem of using session variables, but I
have not had any luck. What I want to do is simple, I want to set my userid
and password in a login screen and use it later (in another php form) to log
into the database.
In my login PHP file I have the following:
if(isset($_POST['userid']) && isset($_POST['pword'])){
$_SESSION['user'] = $_POST['userid'];
$_SESSION['password'] = $_POST['pword'];
}
In my connect to database PHP file I have:
if(isset($_SESSION['user'])){
$user=$_SESSION['user'];
echo "Print $user";
}else{
echo "Print Missing User";
}
The message I always get is "Print Missing User", so I must assume the
global variable is not working. Can anyone help me out here?
Thanks,
Larry
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php