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, ∼5053🔥, 0💬
Popular Posts:
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service o...
How to Install Docker Desktop 2.5.0 on Windows 10? You can follow this tutorial to Install Docker De...
Where to find tutorials on RSS specifications? I want to learn it to describe my API services. Here ...
How to use "json-to-xml" Azure API Policy Statement? The "json-to-xml" Policy Statement allows you t...
How to pull NVIDIA CUDA Docker Image with the "docker image pull nvidia/cuda" command? If you are ru...