Still doesn't work for me...no matter what method I use for the session variables, I can't seem to get them to work properly. Therefore, the only way I can achieve what I'm trying to do is to check if the session is started. Of course that limits a lot, since I can not use session variables...
LOGIN PAGE:
$user = "u";
$pass = "p";
//Removes whitespace and makes all lowercase
function prep_for_compare($string) {
$string = trim($string);
$string = strtolower($string);
return $string;
}
$user_entered = prep_for_compare($form_user);
$pass_entered = prep_for_compare($form_pass);
if(($user==$user_entered) && ($pass==$pass_entered)) {
session_name('UNC_Orientation');
session_start();
header ("location:welcome.php");
exit;
} else {
$msg="You entered an invalid login combination. Please try again.";
$msg = urlencode($msg);
header ("location:index.php?msg=$msg");
exit;
}
CHECKLOGIN PAGE:
if($UNC_Orientation) {
//session_start();
echo $UNC_Orientation;
} else {
$msg="You must login before proceeding into the training.";
$msg=urlencode($msg);
header ("location:index.php?msg=$msg");
exit;
}