|
Home >> FAQs/Tutorials >> PHP Script Tutorials and Tips >> Index
PHP Tutorials - Generating a Form
By: FYICenter.com
(Continued from previous topic...)
How To Generate a Form?
Generating a form seems to be easy. You can use PHP output statements to generate the required
<FORM> tag and other input tags. But you should consider to organized your input fields in
a table to make your form looks good on the screen. The PHP script below shows you a good example
of HTML forms:
<?php
print("<html><form action=processing_forms.php method=post>");
print("<table><tr><td colspan=2>Please enter and submit your"
." comments about FYICenter.com:</td></tr>");
print("<tr><td>Your Name:</td>"
."<td><input type=text name=name></td></tr>\n");
print("<tr><td>Comments:</td>"
."<td><input type=text name=comment></td></tr>\n");
print("<tr><td colspan=2><input type=submit><td></tr></table>\n");
print("</form></html>\n");
?>
If you save this script as a PHP page, submit_comments.php, on your Web site,
and view this page, you will see a simple Web form.
(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?
|