This question is more appropriate for the PHP list.
Here is an example:
// if row exists - login/pass is correct
if (mysql_num_rows($result) == 1)
{
// initiate a session
session_start();
// register the user's ID and permission level
list($uid, $uperms) = mysql_fetch_row($result);
$_SESSION{UID} = '$uid';
$_SESSION{UPERMS} = '$uperms';
// redirect to main menu page
header("Location:menu.php");
mysql_free_result ($result);
// close connection
mysql_close($connection);
}
else
// login/pass check failed
{
mysql_free_result ($result);
mysql_close($connection);
// redirect to error page
header("Location: error.php?e=0");
exit;
}
-Steve
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php