|
Home >> FAQs/Tutorials >> PHP Script Tutorials and Tips >> Index
PHP Tutorials - Listing All Values of Submitted Fields
By: FYICenter.com
(Continued from previous topic...)
How To List All Values of Submitted Fields?
If you want list all values of submitted fields, you can write a simple loop
to retrieve all entries in the $_REQUEST array. Below is an improved version of processing_forms.php
to list all submited input values:
<?php
print("<html><pre>");
$count = count($_REQUEST);
print("Number of values: $count\n");
foreach ($_REQUEST as $key=>$value) {
print(" $key = $value\n");
}
print("</pre></html>\n");
?>
If you test this with submit_comments.php on your Web server, you will get something like:
Number of values: 2
name = Fyi Center
comment = Good job.
(Continued on next topic...)
- How To Create a Web Form?
- What Are Form Input HTML Tags?
- How To Generate a Form?
- Where Is the Submitted Form Data Stored?
- How To Retrieve the Submitted Form Data?
- What Happens If an Expected Input Field Was Not Submitted?
- How To Avoid the Undefined Index Error?
- How To List All Values of Submitted Fields?
- What Are Input Values of SELECT Tags?
- How To Specify Input Values for Radio Buttons?
- How To Specify Input Values for Checkboxes?
- How To Retrieve Input Values for Checkboxes Properly?
- How To Supply Default Values for Text Fields?
- How To Remove Slashes on Submitted Input Values?
- How To Support Multiple Submit Buttons?
- How To Support Hidden Form Fields?
- How To Generate and Process a Form with the Same Script?
- How To Submit Values without Using a Form?
- How To Retrieve the Original Query String?
- How To Protect Special Characters in Query String?
- How To Support Multiple-Page Forms?
|