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, 4436🔥, 0💬
Popular Posts:
How to use urllib.parse.urlencode() function to encode HTTP POST data? My form data has special char...
FYIcenter.com Online Tools: FYIcenter JSON Validator and Formatter FYIcenter JSON to XML Converter F...
Where to find tutorials on Visual Studio? I want to know How to learn Visual Studio. Here is a large...
How To Change Text Fonts for Some Parts of a Paragraph? If you want to change text fonts or colors f...
How to Install Docker Desktop 2.5.0 on Windows 10? You can follow this tutorial to Install Docker De...