PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old July 18th, 2004, 02:46 PM
UmneyDurak UmneyDurak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 UmneyDurak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Back button and resubmitting data

Hi.
I'm working on the submittion page. User fill's out the info clicks the submit button and all the info is stored in to sql database. All the info is transfered trough form fields.
The problem is if the user then goes to some other page and click back button it inserts everything in to db again. How can I prevent this from happening?

I was thinking of setting some variable in session on submittion page, then on next page checking if the variable is set. If it is submitting everything to db then "unsetting' the variable.
Will this be a good way of doing this?

EDIT:
Ok I tried that and it works when user goes to next page then clicks back. But if the user clicks the back button to go to submittion page then forward again, it still resubmites everything.

Thx.

Reply With Quote
  #2  
Old July 19th, 2004, 07:46 PM
daidalus13 daidalus13 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 16 daidalus13 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 12 m 51 sec
Reputation Power: 0
I solved this problem in a rather crude way...
I chose three or four fields that make the information submitted by my users unique and then added a few lines in my code that check on my database if the information that is about to be submitted already exists. The question is, can you find two or three fields in your form that their combination is impossible (or at least highly improbable) to be identical between two different submissions?
I don't know if this helps. It works ok on my application.
daidalus13

Reply With Quote
  #3  
Old July 20th, 2004, 02:57 PM
UmneyDurak UmneyDurak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 UmneyDurak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, yeah I think I will got that way too. Just thought there might be a more eligant way of doing it.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Back button and resubmitting data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway