Hi, I have a newbie problem regarding session, the 1001th session problem on here I am sure but I did read through the articles on here and could not solve. So maybe you guys can help.
Below is the main code that register the session variable.
I have this in a file called sessions.php .. but when I get forwarded to the other page by header("Location: /userarea/index.html"), I can no longer access the $uid value. I have session_start() in all my pages.
Session_auto_start is on .. so is register_global, and trans-sid.
<?PHP
//connects to server and authenticate user .. if user is authenticated, then send to user area.
require_once("db_connect.php");
$uid = strtolower($_POST[username]);
$pw = md5(strtolower($_POST[password]));
$sql = "SELECT * FROM user_table WHERE username = '$uid' and password ='$pw'";
$result = mysql_query($sql);
if(mysql_num_rows($result) > 0){
session_start();
session_register("uid");
$_
header("Location: /userarea/index.html");
} else {
header("Location: /index.html");
}
mysql_close($db_connection);
?>
Can anyone help?