If Else go to new page....
Posted: Tue Apr 22, 2008 9:28 am
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Good Day,
I have a form. If users enter in the wrong password, I would like an error message to display and the user to be directed to my signin page. Unfortunately my if else statement doesn't work. It produces errors. My code is:
The error I receive is:
Wrong Username or Password
Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/a/b/jaberkjaber/html/askslicky/checklogin.php:26) in /home/content/j/a/b/jaberkjaber/html/askslicky/checklogin.php on line 27
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Good Day,
I have a form. If users enter in the wrong password, I would like an error message to display and the user to be directed to my signin page. Unfortunately my if else statement doesn't work. It produces errors. My code is:
Code: Select all
if($result!= $myusername || $result!= $mypassword){
echo "Wrong Username or Password";
header("location:signup.php");}
else {// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
}
?>Wrong Username or Password
Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/a/b/jaberkjaber/html/askslicky/checklogin.php:26) in /home/content/j/a/b/jaberkjaber/html/askslicky/checklogin.php on line 27
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: