Page 1 of 1

need help! user backing up over DB Update script.

Posted: Fri Nov 21, 2003 5:52 pm
by ragnar
Does anyone know of a good method of possibly using session vars to make sure a user only submits a DB update one time.

Currently my setup is this:

1. ACTION PAGE: User clicks button linked to dbUpdate.php with $move=1 in URL which gives them access to execute script.
2. UPDATE PAGE: dbUpdate.php runs, does it's thing, then redirects back to original page for more choices.
3. HOWEVER. If user is safely back on the ACTION PAGE after having updated the DB with their selection, they could possibly hit the Browser's BACK Button and that page would load again dumping the data everywhere.

?? Is there a slick way to register a session var on the ACTION PAGE and then use it to allow the UPDATE PAGE to load. Once inside the Check Point in the UPDATE PAGE, Kill the session var so user couldn't back up.

This isn't working but that is as far as i have gotten. Hoping someone has a good idea on this.

Thanks in Advance!

Ragnar.

Posted: Sat Nov 22, 2003 6:06 pm
by Linkjames
Simply set a variable using sessions once they are finished on the update page. Have the action page check if they have this session variable set, and dissallow them to use the form if it is.

Posted: Sun Nov 23, 2003 12:59 am
by ragnar
I use the ACTION Page to fire the UPDATE Page over and over again. If I set the session and leave it open, I can then only use the ACTION > UPDATE sequence once unless I destroy the session var somewhere in the loop that simultaneously disallows backing up over the UPDATE page while still allowing for a valid firing of the UPDATE Page from the ACTION page.

Thanks for responding. It is much appreciated.