Re: hrm...only hit submit once
| From: | Chris Lee | Date: | Tue, 27 Feb 2001 22:45:54 +0000 |
| Subject: | Re: hrm...only hit submit once | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41926@lists.php.net to get a copy of this message | ||
<?php
include_once('session.egn');
if (isset($HTTP_POST_VARS['submit']))
if ( isset($HTTP_SESSION_VARS['done']) AND $HTTP_SESSION_VARS['done'] ==
$PHP_SELF)
{
echo "a <br>\n";
echo "You can only press submit once <br>\n";
exit();
} else
{
echo "b <br>\n";
$done = $PHP_SELF;
session_register('done');
}
// do some code
echo "
<form method='post' action='$PHP_SELF'>
<input type='hidden' name='submit' value ='1'>
<input type='submit'>
</form>
";
?>
try this, this allows you to load the page, press submit once, and not
again.
--
Chris Lee
Mediawaveonline.com
ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120
lee@mediawaveonline.com
"Kurth Bemis" <kurth@usaexpress.net> wrote in message
news:4.3.2.7.2.20010227182027.0173d780@mail.usaexpress.net...
> i have a form set that my users can fill out thier information. at the
end
> of the process the results are mailed to an email address. then only
> problem is that reloads the page the mail is send again. this can be a
> problem...any ideas on how to prevent it??
>
> ~kurth
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>