1.

What Happens If An Expected Input Field Was Not Submitted?

Answer»

Obviously, if an expected input field was not submitted, there will no entry in the $_REQUEST array for that field. You may get an execution error, if you are not checking the EXISTENCE of the expected entries in $_REQUEST. For example, if you copy processing_forms.php to your local Web server, and run your browser with http://localhost/processing_forms.php?name=Joe, you will an error page like this:
You have submitted the following INFORMATION:
Name = Joe
COMMENTS =
Thank you!
PHP Notice: UNDEFINED index:
comment in ...\processing_forms.php on line 3

Obviously, if an expected input field was not submitted, there will no entry in the $_REQUEST array for that field. You may get an execution error, if you are not checking the existence of the expected entries in $_REQUEST. For example, if you copy processing_forms.php to your local Web server, and run your browser with http://localhost/processing_forms.php?name=Joe, you will an error page like this:
You have submitted the following information:
Name = Joe
Comments =
Thank you!
PHP Notice: Undefined index:
comment in ...\processing_forms.php on line 3



Discussion

No Comment Found