Hi,
First post here, so want to say hello to everyone.
I know this is bad form, first post asking a question, but I thought I may as well get down to it...
I am quite new to PHP andhave a query I hope someone can help me resolve.
I am coding a Change Password routine and am having differing results with error handling. Basically, if a user enters an incorrect password, when I run the following code:
nothing really happens except the three "password" textboxes get cleared and the process starts again. This is fine, but there is no feedback to the user telling them they have entered an incorrect stored password. Similar happens when they enter new passwords that do not match.Code:{ header("Location: change_password.php"); exit("New Passwords do not match."); }
So, to try to give them some feedback, I tried this code instead:
what happens now is they get an alert box informing them of their error, but once I click "Ok" the program stops altogether and the screen clears, then the error description in the exit statement is printed.Code:{ print '<script type="text/javascript">'; print 'alert("The new Passwords entered do not match.")'; print '</script>'; header("Location: change_password.php"); exit("New Passwords do not match."); }
Can anyone help please!
Thanks![]()






Bookmarks