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/