Re: Re: Form Submission
| From: | Torsten Roehr | Date: | Tue, 06 Jul 2004 13:40:51 +0000 |
| Subject: | Re: Re: Form Submission | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189793@lists.php.net to get a copy of this message | ||
"Jason Wong" <php-general@gremlins.biz> wrote in message
news:200407062137.09068.php-general@gremlins.biz...
> On Tuesday 06 July 2004 17:50, Torsten Roehr wrote:
>
> > > How can I check if a form has been submitted, I have seen a demo that
> > > uses the following:
> > >
> > > if(isset($HTTP_POST_VARS))
> > >
> > > But I understand that $HTTP_POST_VARS is depricated...
> > >
> > > Thanks for your help
> >
> > Check the $_POST superglobal:
> >
> > if (isset($_POST['name_of_your_button'])) {
> > }
>
> It might not be a good idea to rely on the "submit" button to be set. Some
> browsers do not set/send it if you didn't explicitly click on the "submit"
> button. I would use:
>
> if (!empty($_POST)) { ... }
How do you check which button was pressed (read: which action should be
performed) when using this check?
Regards, Torsten