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, ∼6103🔥, 0💬
Popular Posts:
Why I am getting "The Windows SDK version 8.1 was not found" error, when building my C++ application...
How to register and get an application ID from Azure AD? The first step to use Azure AD is to regist...
How To Copy Array Values to a List of Variables in PHP? If you want copy all values of an array to a...
How To Convert a Character to an ASCII Value? If you want to convert characters to ASCII values, you...
How to start Docker Daemon, "dockerd", on CentOS systems? If you have installed Docker on your CentO...