isset($foo), $_POST, and E_STRICT
Posted: Tue Feb 15, 2011 3:48 pm
As a rule, I declare all variables, even if that means initializing them to empty strings as is, I understand, good practice. I'm not really sure what to do about this with regards to form fields, though.
generates 'Undefined index' notices.
seems a little needlessly verbose.
Do you just declare them all at the beginning of the page, or am I missing something else?
Code: Select all
if ($_POST['field'] == 'value')Code: Select all
if (isset($_POST['field']) && $_POST['field'] == 'value')Do you just declare them all at the beginning of the page, or am I missing something else?