jbroder
01-09-2000, 10:40 PM
I made a signup table in mysql with userid and password fields.
When a user comes back, I want to ask for the userid and password and send the authenticated user to the user's folder.
When the login fails, I want to throw up a failure page.
Here is the php I wrote to do this:
if ($result) {
// get a handle on the failed condition
if (!mysql_result($result,0,"usernum")){
echo "Bad Login";
die;
}
// send to user's directory
$homer =[nbsp][nbsp]mysql_result($result,0,"usernum");
Header( "Location:http://www.guitarwar.com/users/$homer");
}
This works for an authentic signon. It send the user to the correct directory. But when the password/id combination fails, I get this php error:
Unable to jump to row 0 on MySQL result index 2 in /big/dom/xguitarwar/www/login.php on line 25
I would like to surpress that error and throw up my own error message. Any suggestions?
Jon
When a user comes back, I want to ask for the userid and password and send the authenticated user to the user's folder.
When the login fails, I want to throw up a failure page.
Here is the php I wrote to do this:
if ($result) {
// get a handle on the failed condition
if (!mysql_result($result,0,"usernum")){
echo "Bad Login";
die;
}
// send to user's directory
$homer =[nbsp][nbsp]mysql_result($result,0,"usernum");
Header( "Location:http://www.guitarwar.com/users/$homer");
}
This works for an authentic signon. It send the user to the correct directory. But when the password/id combination fails, I get this php error:
Unable to jump to row 0 on MySQL result index 2 in /big/dom/xguitarwar/www/login.php on line 25
I would like to surpress that error and throw up my own error message. Any suggestions?
Jon