RE: [PHP-INST] Preventing dubbelsubmit in forms??
| From: | christian skaiaa | Date: | Tue, 20 May 2003 17:08:22 +0000 |
| Subject: | RE: [PHP-INST] Preventing dubbelsubmit in forms?? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-20013@lists.php.net to get a copy of this message | ||
It didn't work.
If ($_SERVER['request_method'] == "POST") {
if(!isset($_SESSION['form_posted'])) {
$newLink = new Index($name, $url, $cat, $about, $date);
$_SESSION['form_posted'] = 1;
}
}
I am creating an object from a class I have made. It works when I leave
out your script.
Any Ideas?
Chris
-----Original Message-----
From: Matt Babineau [mailto:matt@criticalcode.com]
Sent: 20. mai 2003 17:27
To: 'christian skaiaa'
Subject: RE: [PHP-INST] Preventing dubbelsubmit in forms??
Could just do a session variable on the post:
If ($_SERVER['request_method'] == "POST") {
if(!isset($_SESSION['form_posted'])) {
//process all your form posting stuff
$_SESSION['form_posted'] = 1;
}
}
Matt Babineau
www.criticalcode.com
e:: matt@criticalcode.com p:: 603.943.4237
| -----Original Message-----
| From: christian skaiaa [mailto:christian.skaiaa@broadpark.no]
| Sent: Tuesday, May 20, 2003 11:13 AM
| To: php-install@lists.php.net
| Subject: [PHP-INST] Preventing dubbelsubmit in forms??
|
|
| Hi,
|
| I wonder if anybody has any advice on how to prevent
| dubbelsubmitting a form. If the user refreshes the webside
| the formdata get posted twice. Any nifty tricks?
|
| Thanks
|
| Christian
|