session_register()

From: Date: Tue, 13 Feb 2001 02:57:20 +0000
Subject: session_register()
Groups: php.general 
Request: Send a blank email to php-general+get-39316@lists.php.net to get a copy of this message
Hiya Could some one please give me a step in the right direction, I've created a simple login script that checks the data base against the user name and password that the user has inputted in aform, i want to have stored in the session their user name and password, as well as their email. I can get everything to work nicely except getting and saving the email from the database. My code is below, Thanks in advance Peter <? session_start(); if ($REQUEST_METHOD=='POST') { header('Expires: ' . gmdate("D, d M Y H:i:s", time()+1000) . ' GMT'); header('Cache-Control: Private'); } session_register('user'); session_register('pass'); session_register('email'); $session = session_id(); $userid = '$user'; ?> <html> <head> <title>Title</title> </head> <body> <? $open = mysql_connect("localhost", "root", "password") or die ("Unable to connect to server."); mysql_select_db("db") or die ("Unable to select database."); $sql = "SELECT * FROM users WHERE user='$user' and pass='$pass'"; $result = mysql_query($sql) or die ("Unable to get results."); $num = mysql_numrows($result) or die ("You're not authorized to be here. If you feel you have recieved this message in error, please contact the <a href=\"mailto:\">webmaster</a>"); if ($num == 1) { include "quote2.php"; } ?> </body> </html>

« previous php.general (#39316) next »