PDA

View Full Version : prob in submit a form



gurmeet
09-01-2009, 03:47 AM
hi... i am using a form to feed back some data in my web page.... when use enters data and submits form, the data gets submitted and stored into databse and the page redirected to the page that is specified in the "action"..

-----
but when a usr refresh the page page sves the "resend" option and again submits the data into database... it feeds tha data as many times as usr refresh the page...
----
i want that data to be inserted once only intodatabe... so i need any special coding to stop it...? plz help me by giving ur valueable suggestion...

JShor
09-01-2009, 04:36 AM
Yes, you can make a session to prevent them from refreshing the page. BUt you'd need to post code here so that we can specifically help you. Other than that, we can only point you in the right direction.

JasonDFR
09-01-2009, 05:23 AM
You should avoid using session to hold information about the state of your website when there is another solution. In this case the better solution is to use:
header("Location: http://www.yoursite.com/");
exit; to redirect to another page after successful form submission.