[thelist] deleting php vars
Paul Bennett
paul at teltest.com
Mon Nov 3 11:41:20 CST 2003
jan guichelaar [artmiks] wrote:
>unset ( $HTTP_POST_VARS['var_name']);
>
>looks promising, but when i refresh the page, the vars are still there,
>Still dont know how to prevent people to refresh the page and thus
>executing the same php-code with the same vars twice.
>:-(
>
>
oh, *that* is what you are trying to do. You could try setting a cookie
when the page runs - something like 'run'=1, then if they refresh you
can check for the cookie at the beginning of your script and if it
exists, don't run the code. This of course will only work with JS enabled.
Other than that you could enter the users session id (you can append
these to the url if you want to get all the non-js browsers) in a db
table when the code is run and then at the beginning of your script
check if the id already has an entry in the table. If it does you now
not to run the code.
Ah, the joys of building applications for a stateless protocol.....
:)
--
------------------------------
Paul Bennett
Internet Developer
Teltest Electronic Design
------------------------------
Email: paul at teltest.com
Phone: 64 4 237 4557
Web: http://www.teltest.com
Wap: http://wap.teltest.com
More information about the thelist
mailing list