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, 3959🔥, 0💬
Popular Posts:
How to install "C++/CLI Support" component in Visual Studio? I need to build my Visual Studio C++/CL...
How To Pad an Array with the Same Value Multiple Times in PHP? If you want to add the same value mul...
How to login to the Developer Portal internally by you as the publisher? Normally, the Developer Por...
How to add images to my EPUB books Images can be added into book content using the XHTML "img" eleme...
How to use the "return-response" Policy statement to build the response from scratch for an Azure AP...