Encrypted!
04-09-2006, 06:00 PM
Ok im making a login script, and i want to apply sessions so other pages can sense wether the user is logged in. I can build a login without sessions (pointless), but when i apply them, it doesnt work.
Here is my MySQL queries:
$username = $HTTP_POST_VARS['name'];
$password = md5($HTTP_POST_VARS['pass']);
$result = mysql_query("SELECT COUNT(*) AS numfound FROM members WHERE username='$username' AND password='$password'");
$result_ar = mysql_fetch_array($result);
By using the code above, can anyone tell me how to store the users username in a session and see if there username is stored in the session?
Ive used the session_start() and the session_register() but it doesnt intergrate with my login.
Thanks! Encrypted!
Here is my MySQL queries:
$username = $HTTP_POST_VARS['name'];
$password = md5($HTTP_POST_VARS['pass']);
$result = mysql_query("SELECT COUNT(*) AS numfound FROM members WHERE username='$username' AND password='$password'");
$result_ar = mysql_fetch_array($result);
By using the code above, can anyone tell me how to store the users username in a session and see if there username is stored in the session?
Ive used the session_start() and the session_register() but it doesnt intergrate with my login.
Thanks! Encrypted!