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>

Reply via email to