Re: flushing formdata / flushing the client to prevent resubmitting formdata ?
| From: | dgw at q-logic dot org | Date: | Wed, 12 Jul 2000 10:04:57 +0000 |
| Subject: | Re: flushing formdata / flushing the client to prevent resubmitting formdata ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6109@lists.php.net to get a copy of this message | ||
Its easy, take this as an example (its called index.php):
<HTML>
<BODY>
<?
if ($newrecord) {
mysql_query( "......" );
Header( "index.php" );
}
?>
<FORM>
<INPUT NAME=newrecord>
<INPUT TYPE=submit>
</FORM>
</BODY>
</HTML>
The header line in the middle makes the page load again without the
$newrecord variable. That way, if the user refreshes, it'll simply load
index.php again.
Hope im right :-)
Regards,
David Garcia Watkins
----- Original Message -----
From: "Jeroen Wesbeek" <J.Wesbeek@DoWebWeDo.com>
To: <php-general@lists.php.net>
Sent: Wednesday, July 12, 2000 10:01 AM
Subject: [PHP] flushing formdata / flushing the client to prevent
resubmitting formdata ?
> Hi,
>
> Is there any way of preventing form-data being resubmitted after hitting
> F5/refresh in your client?
>
> Ofcourse you can create a warkaround by giving a form a random number or
> something and check
> if this number has already been submitted in the script that handles the
> form data, but I'd rather
> see if there's a way to flush the client as soon as script is run which
> processes this data.
>
> So.. is there some kind of HTTP header which you can send to the client to
> make sure the data
> won't get re-submitted after refreshing?
>
> Grtz,
>
> Jeroen
>
>
> Jeroen Wesbeek
> Webdevelopper
> DoWebWeDo
> St. Jacobsstraat 16
> 3500 AK Utrecht