RE: [PHP] Re: How to unset a post variable
| From: | Mark Rees | Date: | Fri, 15 Apr 2005 14:08:52 +0000 |
| Subject: | RE: [PHP] Re: How to unset a post variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-213144@lists.php.net to get a copy of this message | ||
Your best bet is to check that the data has not already been inserted
rather than try to fiddle with the post:
Don't know what db you are using but something like
IF NOT EXISTS (SELECT X FROM Y WHERE Z=1)
INSERT INTO Y VALUES X
Cheers
Mark
-----Original Message-----
From: Nieko Maatjes [mailto:php-news@nieko.net]
Sent: 15 April 2005 14:34
To: php-general@lists.php.net
Subject: [PHP] Re: How to unset a post variable
On Fri, 15 Apr 2005 14:08:36 +0200, Mario de Frutos Dieguez
<marfru@cartif.es> wrote:
> My question is, how can i unset $_POST["buttonNew"] or leave it empty
> because when the user refresh the page make insert commans again
because
> the $_POST["buttonNew"] arent empty.
The browser sends $_POST, you can't just tell PHP to accept it the one
time, and not the other, unless you use sessions of course. You might
also try to refresh using a "302"-header I think, but I forgot how it
worked exactly. It makes the browser refresh so that next time the user
presses F5 or something the POST-data doesn't get sent.
--
Nieko Maatjes
http://www.nieko.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Gamma Global : Suppliers of IBM, Compaq, Cisco, Sun Microsystems, 3Com and HP Products.
GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001
2000' REGISTERED COMPANY
**********************************************************************
CONFIDENTIALITY NOTICE:
This Email is confidential and may also be privileged. If you are not the
intended recipient, please notify the sender IMMEDIATELY; you should not
copy the email or use it for any purpose or disclose its contents to any
other person.
GENERAL STATEMENT:
Any statements made, or intentions expressed in this communication may not
necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content
herein may be held binding upon Gamma Global (UK) Ltd or any associated company
unless confirmed by the issuance of a formal contractual document or
Purchase Order, subject to our Terms and Conditions available from http://www.gammaglobal.com
E&OE
**********************************************************************
**********************************************************************