I have a question and hope you have the answer to it. When submitting data from one form to the next page for processing, is it better to check the global array as a whole e.g.
isset($_POST)
or
isset($_POST['value'])
My question is applicable to all global arrays like $_POST, $_SESSION, $_FILES, etc. The reason is that I get a lot of bad handling to deal with caused by checking if certain variables are checked or not.
$_POSTand the other superglobals are always defined, soisset($_POST)and such is meaningless (it will always returntrue).The second check is what you should use.