Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Avoid the Undefined Index Error
How To Avoid the Undefined Index Error? - PHP Script Tips - Processing Web Forms
✍: 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");
?>
2007-04-23, 12710👍, 0💬
Popular Posts:
Give me the example of SRS and FRS SRS :- Software Requirement Specification BRS :- Basic Requiremen...
What print out will the folloging code produce? main() { char *p1=“name”; char *p2; p2=(char*)malloc...
How To Create an Add-to-Netvibes Button on Your Website? - RSS FAQs - Adding Your Feeds to RSS News ...
How can I implement a variable field width with printf? That is, instead of something like %8d, I wa...
.NET INTERVIEW QUESTIONS - Where do you specify session state mode in ASP.NET ? The following code e...