Home arrow PHP arrow Page 2 - PHP 101 (Part 2) - Shakespeare's Rose

Form... - PHP

Now that you've got the basics of PHP variables and operators down, the second article in this series takes a look at PHP's form-processing capabilities, and introduces you to the comparison and logical operators and the "if-else" and "switch" family of conditional statements.

TABLE OF CONTENTS:
  1. PHP 101 (Part 2) - Shakespeare's Rose
  2. Form...
  3. ...And Function
  4. Operating With Extreme Caution
  5. Shakespeare In The Matrix
  6. If Not This, Then What?
  7. Fortune Smiles
  8. Submitting To The King
  9. Miscellaneous Notes
By: Vikram Vaswani and Harish Kamath, (c) Melonfire
Rating: starstarstarstarstar / 11
August 08, 2000

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
Forms have always been one of quickest and easiest ways to add interactivity to your Web site. A form allows you to ask customers if they like your products, casual visitors for comments on your site, and pretty girls for their phone numbers. And PHP can simplify the task of processing the data generated from a Web-based form substantially - as our first example demonstrates.

<html> <head> <basefont face="Arial"> </head> <body> <center> <form method="GET" action="login.php4"> <table cellspacing="5" cellpadding="5" border="0"> <tr> <td> <font size="-1">So what's your name?</font> </td> <td align="left"> <input type="text" name="name" size="10"> </td> </tr> <tr> <td colspan="2" align="center"> <input type="submit"> </td> </tr> </table> </form> </center> </body> </html>
The most critical line in this entire page is the <FORM> tag


<form method="GET" action="./login.php4"> ... </form>
As you probably already know, the ACTION attribute of the <FORM> tag specifies the name of the server-side script - "login.php4" in this case - that will process the information entered into the form, while the METHOD attribute specifies the manner in which the information will be passed.

 
 
>>> More PHP Articles          >>> More By Vikram Vaswani and Harish Kamath, (c) Melonfire
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap

Dev Shed Tutorial Topics: