PHP 101 (Part 2) - Shakespeare's Rose - Form... (
Page 2 of 9 )
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.