Hi Shaun,

Your  expression is evaluating, if you like does the $_POST superglobal
exist and it does
but might be empty, this would be the same for $_GET and other superglobals.

If you did the following:

if (isset($_POST) && !empty($_POST)) {
   echo '(isset($_POST))';
}

This would only appear if there was in fact a $_POST variable 'set'.

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.

HTH,

Craig

"Shaun" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I am trying to create some code to check whether a form has been
submitted.
> The following code seems to print evertime, whether a form has been
> submitted or not:
>
> if (isset($_POST)) {
>   echo '(isset($_POST))';
>  }
>
> This seems most odd, could someone tell me why this happens?
>
> Thanks for your help.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to