467,907 Members | 1,382 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,907 developers. It's quick & easy.

how do I stop or cancel a page refresh?

I made a web app, some form data is posted to a report.html that makes changes
to a database. if the user does this and views the report, and then refreshes
the web page the same information and process happens again which is bad. how
do I stop or warn and give the option of canceling a page refresh request?

I'm using PHP but don't think that matters. I'm hoping theres some fancy
javascript trick with onunload or something.

thanks.
Jul 20 '05 #1
  • viewed: 15759
Share:
1 Reply
Ken Williams wrote:
I made a web app, some form data is posted to a report.html that
makes changes to a database. if the user does this and views the
report, and then refreshes the web page the same information and
process happens again which is bad.
You need to have server side validation to prevent bad data. There is no
way around this.
how do I stop or warn and give the option of canceling a page refresh
request?
My everyday web browser, Mozilla, warns me on its own, with no help from
authors, when I try to reload a post. I think MSIE does this, too,
doesn't it?
I'm using PHP but don't think that matters.
It doens't matter which scripting language you use, no. But PHP might be
where you create the validation to avoid resubmitting the same data,
presumably in conjunction with your db.
I'm hoping theres some fancy javascript trick with onunload or
something.


That wouldn't help with visitors who don't have js, would it?

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Geoff | last post: by
6 posts views Thread by Baffin Shea | last post: by
4 posts views Thread by JohnSouth104 | last post: by
1 post views Thread by magic man via .NET 247 | last post: by
8 posts views Thread by Matt Theule | last post: by
13 posts views Thread by Mickey | last post: by
8 posts views Thread by Richard Maher | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.