Resetting http_post_vars

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
mjstehn
Forum Newbie
Posts: 5
Joined: Fri Aug 20, 2004 4:25 pm

Resetting http_post_vars

Post by mjstehn »

I have a page that basically you click on a couple of dymamic lists and then submit. It will insert the records into the database. The HTTP_POST_VARS are set and if the page refreshes I get a duplicate entry error for the database. Is there anyway to reset these after the record has been inserted into the database? Thanks,

Mike
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Post by William »

$HTTP_POST_VARS = "";

Maby that will work I never use that function so I would have to look it up if that dont work.
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

I suggest unset($HTTP_POST_VARS);

Also, I would suggest using the $_POST autoglobal istead, as $HTTP_POST_VARS is long depreciated.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

set a session variable that says they've already submitted it once.
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

isset to check for a session var to see if its already present would be my route.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

*blink*

uhh.. :D
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

is there something in your eye?

I mentioned the isset function in case he/she wasnt aware of the function. I know you already suggested the session var, i was agreeing.

dont beat me up
Post Reply