I'm having a problem passing SESSION variables from page to page. Right
now, I have this code at the top of my page:
if(!$_SESSION['logged_in']) include "login.php" ;
This is the code for the login form:
if($submit != "") {
$login_results = loginCheck($ema il, $password);
if($login_resul ts) {
session_start() ;
$_SESSION['logged_in'] = "true";
$login_values = mysql_fetch_arr ay($login_resul ts);
foreach($login_ values as $index => $value) {
$_SESSION[$index] = $value;
}
}
else displayLoginFor m(displayLoginF ailure());
}
else displayLoginFor m();
....
....
Another form appears down here -> submitting reloads page.
Upon going back to this page again once the SESSION variables were set,
I'm sent back to the login screen again. I checked, and the SESSION
variables don't exist anymore after reloading the screen. This sounds
like a globals problem, but I thought those only applied to GET, POST,
and the like. Any ideas what could be going on here?
Thanks,
Aaron
P.S. I'm going straight to the boards tonight instead of doing my own
research, as I'm pressed for time with a school project due, so please
ezcuse the newbie question.
now, I have this code at the top of my page:
if(!$_SESSION['logged_in']) include "login.php" ;
This is the code for the login form:
if($submit != "") {
$login_results = loginCheck($ema il, $password);
if($login_resul ts) {
session_start() ;
$_SESSION['logged_in'] = "true";
$login_values = mysql_fetch_arr ay($login_resul ts);
foreach($login_ values as $index => $value) {
$_SESSION[$index] = $value;
}
}
else displayLoginFor m(displayLoginF ailure());
}
else displayLoginFor m();
....
....
Another form appears down here -> submitting reloads page.
Upon going back to this page again once the SESSION variables were set,
I'm sent back to the login screen again. I checked, and the SESSION
variables don't exist anymore after reloading the screen. This sounds
like a globals problem, but I thought those only applied to GET, POST,
and the like. Any ideas what could be going on here?
Thanks,
Aaron
P.S. I'm going straight to the boards tonight instead of doing my own
research, as I'm pressed for time with a school project due, so please
ezcuse the newbie question.
Comment