PHP4实际应用经验篇

  表单是一种给你的站点增加交互功能的最快,最容易的途径。表单允许你询问你的顾客是否喜欢你的产品,让不经意访问到你的站点的访问者留下评论,或者向漂亮的美眉们要她们的电话号码。PHP能大大简化基于网页表单提交的数据处理工作-如下面我们的第一个例子所示:
  --------------------------------------------------------------------------------
  <html>
  <head>
  <basefont face="宋体">
  </head>
  <body>
  <center>
  <form method="GET"action="login.php">
  <table cellspacing="5"cellpadding="5"border="0">
  <tr>
  <td>
  <font size="-1">请问你的名字是?</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>
  --------------------------------------------------------------------------------
  整个页面最值得注意的是那个<FORM>标签
  --------------------------------------------------------------------------------
  <form method="GET"action="login.php">
  ...
  </form>
  --------------------------------------------------------------------------------
  你可能已经知道了,<FORM>标签的ACTION属性值明确指定了将处理表单里输入的信息的服务器端脚本名-在这里是"login.php",而METHOD属性是说明信息将如何传送。