session help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
watsonw
Forum Newbie
Posts: 1
Joined: Wed Feb 04, 2009 4:24 pm

session help

Post by watsonw »

i need help on this page i am coding... i need to make it not be able to go back and allow the users to enter in the same data or go back and repost same data....the error i am having is a user can create a "case" and then hit backspace and go back to the main menu and see redo the same work, duplicating himself...how can i stop this? thank you
watson516
Forum Contributor
Posts: 198
Joined: Mon Mar 20, 2006 9:19 pm
Location: Hamilton, Ontario

Re: session help

Post by watson516 »

If you're using a db, you could check the entry against the db. If the user has entered that information before, redirect and error or just redirect to the page it would have redirected to if they had entered a new entry but with the old entry's information.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: session help

Post by requinix »

Woah, weird, I thought you were replying to yourself :crazy:

The typical answer is to put something into $_SESSION saying what data got entered, then when you do the insert you make sure that the data doesn't exist in $_SESSION already.
But really, what watson516 said is just as easy and doesn't require storing more information than necessary.
User avatar
Skoalbasher
Forum Contributor
Posts: 147
Joined: Thu Feb 07, 2008 8:09 pm

Re: session help

Post by Skoalbasher »

I was about to post that.. ^^^^^^^^

edit: ok, not that, the one before it.
Post Reply