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, ∼4922🔥, 0💬
Popular Posts:
How to use "{{...}}" Liquid Codes in "set-body" Policy Statement? The "{{...}}" Liquid Codes in "set...
Where to get the detailed description of the json_encode() Function in PHP? Here is the detailed des...
What Happens If One Row Has Missing Columns? What happens if one row has missing columns? Most brows...
How To Truncate an Array in PHP? If you want to remove a chunk of values from an array, you can use ...
How to use the urllib.request.Request object to build more complex HTTP request? The urllib.request....