Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User notifications after "POST"

Status
Not open for further replies.

awingnut

Programmer
Feb 24, 2003
759
US
How can I issue an error to the user after a "POST" such that it will not disturb the data already entered on the posted form? I want to do the equivalent of a javascript 'alert' but after the "POST". Everything I've tried so far rewrites the page and destroys the entries on the form. I need to let the user fix the problem without losing all the entries. TIA.
 
you must fill the form with the entered values, e.g.:

echo "<input type=text name=Name value=" . $_POST['Name'] . ">";

Cheers.
 
That is exactly what I didn't want to have to do. Way too complicated to do that. I'm going to have to try and figure out how to check what I need to check on the client side. Thanks anyway.
 
Yes, but it means passing server side information to the client so javascript can verify it with user input. I didn't really want that information on the client.
 
not necessarialy (sorry, don't know how to write it in english), keep in mind that all info is entered by the user, so their browser can verify the content of the form before to send it to the server.
 
That is exactly what I didn't want to have to do. Way too complicated to do that.

Welcome to the world of writing PHP applications. No shortcuts possible. If you want server side validation, that's what you got to do. Sorry!
You can go the client side route, before the POST, but if the client doesn't have JS turned on, you'll get crappy data. Sound programming does not accept data from the client unconditionally - which includes client side validation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top