Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browser BACK after submit

Status
Not open for further replies.

curvv

IS-IT--Management
Jan 11, 2001
103
ZA
Hi,

I've developed a time recording system for our company using mySQL and PHP. Normally when a form is submitted and the user uses his browser's back button, some message saying click retry to send this form again bla bla appears. The users on our intranet uses their back buttons which is causing the data to be submitted more than once. ow can I get around this??

thanx ######## CtN ########
 
This will happen with any form anywhere, unless you provide for it, by setting some variable indicating form submission has just taken place.

This way the form is only submitted if the varable is not set - otherwise the form is cleared.
 
thanx

I'll use a hidden field for this. ######## CtN ########
 
I'm not entirely sure how to do this. I've thought about it for a while but can't seem to work it out.

If you could just point me in the right direction here, I'll be very greatful.

thanx ######## CtN ########
 
Well you need to be able to set a session type variable - sometimes this is thought to be memory heavy - so you could simply set a cookie after the form is sent.

This way it is simple to check for the cookie each time the form loads - and reset it if necessary, and inform the user they just submitted the form - then direct them someplace else.

Have a look at cookies, and session_register in your php help files.

[bb]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top