Bluehost.com Web Hosting $6.95

Refreshing in forms using post

This is a discussion on Refreshing in forms using post within the PHP General forums, part of the PHP Programming Forums category; Suppose I have a form. Upon submission, the metadata is posted to a processing script (a separate PHP file), which ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-01-2003
Matt Grimm
 
Posts: n/a
Default Refreshing in forms using post

Suppose I have a form. Upon submission, the metadata is posted to a
processing script (a separate PHP file), which parses it and then sends the
user back to a particular page using the header function. If said user
clicks their browser's back button, the aforementioned processing script
will re-parse that post data and create a duplicate record. How can I
prevent this? Cache control?

Thanks,
--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: mgrimm@healthtvchannel.org
Web: www.healthtvchannel.org
Reply With Quote
  #2 (permalink)  
Old 12-01-2003
Marek Kilimajer
 
Posts: n/a
Default Re: [PHP] Refreshing in forms using post

What header are you using? If you use Location header, this should not
happen.

Matt Grimm wrote:
> Suppose I have a form. Upon submission, the metadata is posted to a
> processing script (a separate PHP file), which parses it and then sends the
> user back to a particular page using the header function. If said user
> clicks their browser's back button, the aforementioned processing script
> will re-parse that post data and create a duplicate record. How can I
> prevent this? Cache control?
>
> Thanks,
> --
> Matt Grimm
> Web Developer
> The Health TV Channel, Inc.
> (a non - profit organization)
> 3820 Lake Otis Parkway
> Anchorage, AK 99508
> 907.770.6200 ext. 686
> 907.336.6205 (fax)
> E-mail: mgrimm@healthtvchannel.org
> Web: www.healthtvchannel.org
>

Reply With Quote
  #3 (permalink)  
Old 12-02-2003
Richard Davey
 
Posts: n/a
Default Re: [PHP] Refreshing in forms using post

Hello Matt,

Monday, December 1, 2003, 10:31:23 PM, you wrote:

MG> Suppose I have a form. Upon submission, the metadata is posted to a
MG> processing script (a separate PHP file), which parses it and then sends the
MG> user back to a particular page using the header function. If said user
MG> clicks their browser's back button, the aforementioned processing script
MG> will re-parse that post data and create a duplicate record. How can I
MG> prevent this? Cache control?

There is no 100% reliable method of controlling the cache of any
browser. Why not, in your processing script, set a flag or issue
something to the users session to the effect of "already submitted
this form". Then if they do click back and submit it all again you can
check for the existence of this value and give them a nice friendly
error message ("Thanks for your enthusiasm, but you've already done
this!") :)

--
Best regards,
Richard mailto:rich@launchcode.co.uk
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:27 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0