chrometweaks.org

Need a little more information about iPage web hosting?

Click Here To View All Answers...


First off, Need a little more information about iPage web hosting? Looking forward for any answer or 2. My 2nd question... I am using a form that sends the data to a file that then gets displayed on the screen..

The thing I would like to prevent is that after the page reloads and the from is displayed again, if the user clicks on the refresh button of the browser, I don't want it to submit the same data again. I have a reload button that can be used to bypass this problem, but I would like to make double sure the data is not resubmitted if the person clicks the refresh button on the borwser instead of the reload button on the form. How is this done?.

Thanks,.

Kevin..

Comments (6)

Hmm... I need to find out myself. I don't know what is the answer. I'll do some investigation and get back to you if I got an anything. You should email the people at iPage as they probably could answer your iPage question..

Comment #1

Hey, if your sending to a database...you have some options:.

Set up two form actions: 1 if the user has never submitted the form before-go ahead and submit it, and 2 if the user has submitted previously-pop up an alert..

Then all you'd need to do is send an additional field to the database as a boolean value, and read from the database when the user loads the page. You might have to ask the user to login or some other way of checking who the user is, and what the past actions for the user is...

Comment #2

Hey Dr. Web, can I just call you Web?.

The scary part is I think I actually know and understand what you said.

The data is just going to a flat file, and I am trying to avoid username/passwords/logins. I was hoping there was an obscure form tag/attribute or a special META tag that could block or not allow a form to cache submitted data. Or maybe a JAVA script that could somehow do something like that. Like it could detect that the refresh button on the browser was clicked on, and purge any data stored in the form before the form goes ahead and resubmits and the page reloads....sound possible?.

Regards,.

Kevin..

Comment #3

I guess this means I can take comfort in the fact that I didn't understand a word ANY of you said!..

Comment #4

Hi kevin,.

You can do something simple like include a hidden variable on the first form, like "first_add" with the value of "Dump", which tells you that the script needs to get ready to dump the data..

An example:.

(NOTE: there is a hidden tag on the first form, not included in display form html).

Would something like this work?.

Regards,..

Comment #5

Hi Jacob,.

Thanks for the response. Maybe something like that could work. It's sorta like a trap door? The only problem is that it is the same form that gets returned after a submition is made. I'm already using copious amounts of hidden fields so that other conditions remain persistent during a session..

My problem comes in when the refresh button on the browser is clicked... not any buttons on the form itself. If a person chooses "yes" at the prompt then as you know the previous data is resubmitted, in most cases I guess that is a good thing, but in this case it will result in a duplicate entry into the data file, which is what I want to avoid..

Is there no way to detect if the refresh/reload command of the browser has been clicked on? If there was I could direct the script to bypass writing to any files and just throw up the display again, just like if the reload button on the form was clicked on..

Kevin..

Comment #6

Well I use a session variable. In the form I make a hidden field with a value of the session variable. If the value of the posted variable is smaller than the value of session variable, then I redirect them a page back in history..

Else the submited form will be processed and the value of the session variable increased..

This will not eliminate the warning but at least it will not process the same form twice...

Comment #7


This question was taken from a support group/message board and re-posted here so others can learn from it.