By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,445 Members | 1,159 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,445 IT Pros & Developers. It's quick & easy.

how do I stop or cancel a page refresh?

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.