----- Original Message ----- 
From: phplist_jsh

Consider this statement related to Fields sent to PHP via an HTTP POST.

$A = $_POST["FieldName"];

If the page did not have a form field with FiledName, the result is
that $A is empty.

If the page DID have a form field with FieldName, but the field was
left empty, then $A is empty also.

How should I test $_POST to distinguish between these two conditions.

James S. Huggins
-----------------------------
Hi James,

Use if(isset($_POST['FieldName'])) as it tests for the key rather that the
value. This is also the better way to detect a submit on forms with multiple
submit buttons ie name=submit1, name=submit2 as difererent browsers return
different values for submit buttons.

Rob.

Reply via email to