RE: [PHP] refresh button will mail the form again.
| From: | Tiger Girl | Date: | Thu, 10 Apr 2003 02:12:53 +0000 |
| Subject: | RE: [PHP] refresh button will mail the form again. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143251@lists.php.net to get a copy of this message | ||
Hi there,
Thanks a lot. I just did a quick test. It works!!
Thanks.
TG
-----Original Message-----
From: Jack Dempsey [mailto:dempsejn@georgetown.edu]
Sent: Wednesday, April 09, 2003 8:00 PM
To: tiger@zhufufamily.net; php-general@lists.php.net
Subject: RE: [PHP] refresh button will mail the form again.
just looking quickly at this, but you can't output any _data_ to the
page
before header.....you can do other processing and things though like
sending
mail...
jack
> -----Original Message-----
> From: Tiger Girl [mailto:tiger@zhufufamily.net]
> Sent: Wednesday, April 09, 2003 9:57 PM
> To: php-general@lists.php.net
> Subject: RE: [PHP] refresh button will mail the form again.
>
>
> Hi Mike,
>
> Thanks for your help. But if I have nothing above the header()
command,
> how could I mail out the form data?
>
> Thanks a lot.
>
> TG
>
> -----Original Message-----
> From: Mike [mailto:php-digest@custom87.net]
> Sent: Wednesday, April 09, 2003 12:04 AM
> To: tiger@zhufufamily.net
> Subject: Re: [PHP] refresh button will mail the form again.
>
> If you refresh you are resending the post info. You need to redirect
to
> another page once the post stuff is processed.
>
> header("location: wherever.php"), as long as you don't have anything
> above it ought to work.
>
> -Michael
> On Tue, 2003-04-08 at 20:15, Tiger Girl wrote:
> > Dear Sir,
> >
> > I am new to PHP, currently I just built a form and mail the result
to
> > myself as:
> > in mailform.php:
> > <?php
> > if ($_POST['action'] == 'submitted') {
> > /* mail the form */
> > } else {
> > }
> > ?>
> >
> > in form.php:
> > <form action="mailform.php" method="post">
> > Name: <input type="text" name="personal[name]"><br>
> > Email: <input type="text" name="personal[email]"><br>
> > <input type="hidden" name="action"
> > value="submitted">
> > <input type="submit" name="submit" value="submit
> > me!">
> > </form>
> >
> > I am using PHP 4.3.1 with Apache, it works fine, but if I use the
> > refresh button on the browser, it will send the form again even I
> tried
> > $_POST['action'] = "FALSE". Could you please tell me what I could do
> to
> > prevent it from sending mail again? Or, just discard the form data?
> >
> > Thanks a lot. Really appreciate any help as I only know PHP for one
> > week.
> >
> > TG
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>