Re: Re: Checking for form submission
| From: | Craig Donnelly | Date: | Wed, 04 Aug 2004 10:21:37 +0000 |
| Subject: | Re: Re: Checking for form submission | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192686@lists.php.net to get a copy of this message | ||
Ok, in simple form - If the submit button was clicked,
If some one hits enter this would be a problem, easy way to resolve
this would be to have a hidden form element flagged and to terst for that
instead of the
submit button, wouldnt you agree Jason?
Craig
"Jason Wong" <php-general@gremlins.biz> wrote in message
news:200408041752.36730.php-general@gremlins.biz...
> On Wednesday 04 August 2004 17:34, Craig Donnelly wrote:
>
> > If you want to test to see if a form has been submitted, I would suggest
> > that you
> > use the name from the submit button.
> >
> > e.g - <input type="submit" value="Send Form Data"
> > name="sendform">
> >
> > if(isset($_POST['sendform'])){
> > echo "Form has been submitted!";
> > }
> >
> > So basically this checks if the form button "sendform" is set.
>
> This is not reliable, some browsers does not set the submit button if it
was
> not explicitly clicked on. Even some big name free webmail providers fall
> into this trap of just checking for the submit button rather than checking
> the form as a whole.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> The biggest difference between time and space is that you can't reuse
time.
> -- Merrick Furst
> */