Re: Best way to test for form submission?
| From: | O. Lavell | Date: | Sat, 29 Aug 2009 08:47:09 +0000 |
| Subject: | Re: Best way to test for form submission? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-297467@lists.php.net to get a copy of this message | ||
Shawn McKenzie wrote:
> Adam Jimerson wrote:
>> This question might give away the fact that I am a php noob, but I am
>> looking for the best way to test for form submission in PHP.
[..]
> Just to throw it into the mix:
>
> if(!empty($_POST)) for a general test of whether any form was posted.
There are more methods, I always use:
if($_SERVER["REQUEST_METHOD"] == "POST") {
do_something();
}