Jump to content

Form Submit Problem


jeeva

Recommended Posts

hi frnds,

 

i have one form where the user enter and  submit the data through text box.its working fine but if the user refresh the page, the same data will be submit. Its should not happen while refresh. the page  should open like new.

But i solved this problem by redirecting the page, but i need without redirect page .

 

can i do like that?

 

 

 

jeeva

Link to comment
Share on other sites

well look up in google:

 

"HTML, text field"

 

therell be a link to a w3c and therell be a list of attributes you can set.

 

goo dluck

 

else you could use javascript, but php is the hardest and least easy in this case ithink

Link to comment
Share on other sites

If they keep hitting refresh the browser has the $var, if they are trying to post again and getting old $var the server has the $var. I have not heard of a way of remving a variable on the browser without it being a cookie.

Link to comment
Share on other sites

hi,

 

  the trick here is to redirect back again, so that when the user refreshes the page it won't re submit the data

 

 

  so in the end of the submission process of the data do something like this

 

 

  header("location: whereyouwanthimback.php");

 

 

in this way refreshing, won't make a resubmit of data.

 

cheers

Link to comment
Share on other sites

Hi,

  I hope you are checking whether submit button was clicked or not begore going to insert the data into the database. If you are doing like that you change the button name after you insert the data. that will solve the problem

ex:

      if(strcmp($submit,"Submit") ==0){

          code for inserting data

           

          if success , rename the value of $subit to some othere ..

              $submit="";

      }

 

i hope it is helpful to you

 

-SunilKumar

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.