NYCPHP Meetup

NYPHP.org

[nycphp-talk] Forms & Refresh Question & General Form Security

Wellington Fan wfan at encogent.com
Wed May 14 12:07:29 EDT 2003


All,
On the matter of form refresh problems, I've found that submitting to a
second script works well.
----------------------------
"page_with_form.php"

submits to

"form_processor.php"

which redirects to

"page_with_form.php?status=(success|failure)"
----------------------------

So form_processor.php is strictly for backend stuff, it never prints
anything. The last line would be a header("Location....").

This way a user only ever sees page_with_form.php in his/her browser, and
reloading does no harm and does not re-submit data.

Also, BTW, a kind of useful Javascript tip is to set the onClick() event of
the submit button to 'this.disabled=true' -- this way the user cannot click
the button twice, and they get nice visual feedback.


--
WF




More information about the talk mailing list