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"); ?>
⇒ Listing All Values of Submitted Fields in PHP
2016-11-15, 3468🔥, 0💬
Popular Posts:
Where to get the detailed description of the JSON.stringify() Function in JavaScript? Here is the de...
How to Install Docker Desktop 2.5.0 on Windows 10? You can follow this tutorial to Install Docker De...
How To Merge Cells in a Column? If you want to merge multiple cells vertically in a row, you need to...
How To Open Standard Output as a File Handle in PHP? If you want to open the standard output as a fi...
Where Can I get a copy of the RSS XML Schema? RSS XML Schema is an XML Schema that defines how an RS...