PDA

View Full Version : No Browser Refresh


netroact
02-16-2006, 11:25 PM
I have a perl script that receives my portfolio data from a form, and puts it in a text file, and then displays the data from the file to an html table. I have a conditional that makes sure the submit button is pressed before any data is stored, and displayed. Else, it just displays the table.

Whenever I submit data to the form, it works just fine. But, if I then hit refresh it asks if I want to resend the data, which will add another entry. I usually won't hit refresh at that point, but in case I do, I don't want that prompt to come up. I just want the table to refresh.

This really isn't that important, except that I sometimes get in a hurry, and click yes when the prompt pops up.

Is there any way to make sure that the browser will not attempt to resend the data? I don't think a no-cache will work, because it doesn't work with the back button.

mlseim
02-17-2006, 03:13 AM
I don't think you can prevent the pop-up message, but
you can ignore the data being sent by using sessions.

Read-up on using the sessions module.

Another option would be to have a hidden number on the form
you redisplay ... the script sees that number, it knows that the
form was resent (not the original form) ... you can then ignore it.

Using sessions would be the best though.

netroact
02-17-2006, 03:55 AM
Okay, I will check out that module. I use session id's in my login scripts, but I don't see how that would stop the data.

Thanks for your help.

It's not really that big of a deal. It's just for my use, and I can delete double entries. I just thought someone might have a real simple solution - like in the meta refresh tag or something. You know I'm lazy.
:)