Forum Moderators: coopster
I am developing a protected section of my companies website where customers can register and obtain access to forums, whitepapers, etc.
I have developed the login page, profile pages, etc, but one thing I dont know how to do it make sure that as long as my user is logged in, if they click on the "Profile" link, they will see their, and ONLY their user profile info.
I am investigating global and/or session variables to keep the 'userid' field in memory throughout the session and provide me with a way of always identifying the user.
Am I going down the right path? Any suggestions on where to look, ie - tutorials or something?
Thanks,
Chris
$_SESSION['username'] = '$username';
if (isset($_SESSION['username']))
{
mysql_query("SELECT * FROM table WHERE username = '" . $_SESSION['username'] . "' LIMIT 1") or die(mysql_error());
}
Maybe something like that?