I am using the following script to reset a forgotten password. When the process succeeds, this code occurs on line 124:

error('New Password Sent!.');

When the user clicks OK, the script continues and displays the form again.I want to link to index.php rather than display the form. I've tried several things, but nothing seems to work. I think I'm having a problem of "don't see the forest for the trees". Thanks for your help. Here is the script I'm using:

On success why don't you use PHP's header function to redirect them somewhere? Your use of the Javascript function history.back() is causing them to go back. You should definitely get rid of that, get rid of the Javascript altogether and just output a success message.

On success why don't you use PHP's header function to redirect them somewhere? Your use of the Javascript function history.back() is causing them to go back. You should definitely get rid of that, get rid of the Javascript altogether and just output a success message.

Thank you, cheesedude. I didn't think of the header function. It is just what I need. Probably the reason I didn't think of it, every time I have used this function, I spend a lot of time finding offending white spaces in the code. Thanks much for the suggeston.

I didn't understand why you suggest getting rid of the history.back(). Actually, I don't know why the author included it because it doesn't seem to do any thing. If you could explain this point a little more, I would appreciate it.