unsetting $GLOBALS 
Author Message
 unsetting $GLOBALS

Hi all,
I'm trying to unset all variables in $GLOBALS['HTTP_POST_VARS']; from within
a function. Does anyone know the way to do this? More generally, I'm looking
to get rid of all references to any $_POST variables held either globally or
locally. Hopefully, this should stop customers making multiple orders when
they hit submit twice, or refresh right?
Many thanks.
Sam Jeffers


Tue, 21 Jun 2005 01:57:04 GMT  
 unsetting $GLOBALS


Quote:
> I'm trying to unset all variables in $GLOBALS['HTTP_POST_VARS']; from
> within a function. Does anyone know the way to do this? More
> generally, I'm looking to get rid of all references to any $_POST
> variables held either globally or locally. Hopefully, this should stop
> customers making multiple orders when they hit submit twice, or
> refresh right?

I don't see how that would prevent double-orders by submitting twice or
refreshing. If you destroy it, it'll only be destroyed within that instance
of the script, the browser will just resend it.

KAH



Tue, 21 Jun 2005 03:37:21 GMT  
 unsetting $GLOBALS
You're right of course... Does anyone have any ideas on how to prevent
people resubmitting?
Sam


Quote:


> > I'm trying to unset all variables in $GLOBALS['HTTP_POST_VARS']; from
> > within a function. Does anyone know the way to do this? More
> > generally, I'm looking to get rid of all references to any $_POST
> > variables held either globally or locally. Hopefully, this should stop
> > customers making multiple orders when they hit submit twice, or
> > refresh right?

> I don't see how that would prevent double-orders by submitting twice or
> refreshing. If you destroy it, it'll only be destroyed within that
instance
> of the script, the browser will just resend it.

> KAH



Tue, 21 Jun 2005 03:44:14 GMT  
 unsetting $GLOBALS

Quote:

> You're right of course... Does anyone have any ideas on how to
> prevent people resubmitting?  Sam

Other than inventing your own tests (like checking timestamps in the
database or setting cookies), there is no easy way that I know
of. Anyway, it is probably a good practice to redirect your customer
directly after a POST. That way, you make it a bit harder for him to
resubmit.

--
 A: Because it messes up the order in which people normally read text.
 Q: Why is top-posting such a bad thing?
 A: Top-posting.
 Q: What is the most annoying thing on usenet and in e-mail?



Tue, 21 Jun 2005 06:19:47 GMT  
 unsetting $GLOBALS


Quote:

> Does anyone have any ideas on how to prevent
> people resubmitting?

Check out Reload Preventer at PHPclasses.org:

http://www.phpclasses.org/browse.html/package/876.html

Cheers,
NC



Tue, 21 Jun 2005 07:01:53 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Unsetting cookie values

2. Unsetting a session variable

3. unsetting session vars in php 4.2+

4. unsetting read-only variables

5. unsetting env in slave interpreter

6. unsetting env in slave interpreter

7. Unsetting array vars within procs.

8. Unsetting array with element traces causes Tcl to abort

9. unsetting a itcl class

10. multidimensional arrays (was: Re: Unsetting multidimensional arrays)

11. Unsetting multidimensional arrays

12. Semi-globals

 

 
Powered by phpBB® Forum Software