Hello everyone....i've been battling with this problem for a while now....I created a login script....everything works well except when i want to display error messages to users after they login with wrong values
when i try to do something like this :
if(mysql_num_rows($query) = 0) {
header("Location : login.php?muta=0&ml=".$_POST['username']);
echo "Invalid login detail";
exit();
}
the above code does display muta=0&ml=..'the username' on the URL but does'nt display the error message, but when i removed the line header ("Location : login.php?muta=0&ml=".$_POST['username']); it displayed the error message.
I need help on this as soon as possible.
Displaying error message after redirecting the user
Moderator: General Moderators
Re: Displaying error message after redirecting the user
it's because the user is being sent away before they get the "Invalid login detail"
That'll need to go on the 'login.php' page that your sending them to if you want them to see the message.
'
That'll need to go on the 'login.php' page that your sending them to if you want them to see the message.
'
Re: Displaying error message after redirecting the user
@deejay i dont quite understand wat u saying.....maybe u try nd show me an example
Re: Displaying error message after redirecting the user
Code: Select all
if(mysql_num_rows($query) = 0) {
header("Location : login.php?muta=0&ml=".$_POST['username']);
echo "Invalid login detail";
exit();
}<meta http-equiv="refresh" content="5;url=http://example.com/" />
Hope that helps