Tools, FAQ, Tutorials:
Using isset($_REQUEST('name')) in PHP
How To Avoid the Undefined Index Error in PHP?
✍: FYIcenter.com
If you don't want your PHP page to give out errors as shown in the previous exercise, you should consider checking all expected input fields in $_REQUEST with the isset() function as shown in the example script below:
<?php if (isset($_REQUEST['name'])) { $name = $_REQUEST['name']; } else { $name = ""; } if (isset($_REQUEST['comment'])) { $comment = $_REQUEST['comment']; } else { $comment = ""; } print("<html><pre>"); print("You have submitted the following information:\n"); print(" Name = $name\n"); print(" Comments = $comment\n"); print("Thank you!\n"); print("</pre></html>\n"); ?>
Â
⇒Processing Web Forms in PHP
⇒⇒PHP Tutorials
2016-11-15, 1766👍, 0💬
Popular Posts:
How To Submit Values without Using a Form in PHP? If you know the values you want to submit, you can...
How to use the "send-request" Policy statement to call an extra web service for an Azure API service...
Where is API Management Service on my Azure Portal? If your IT department has signed up for an Azure...
How to add request body examples to my Azure API operation 2017 version to make it more user friendl...
What is EPUB 2.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 2.0 Metadata "dc:publisher" ...