background image

7.1PHP 程序设计语言与网页的表

7.1.2 接收数据输入的网页程序
创建表单 form 
设置表单 form ,指定服务器端处理当前表单数

据的 php 程序,在 action 选项中指明,确定

表单数据的传送方式,在 method 选项中指

明( GET 方式和 POST 方式)

<

form

 

name

=“testform” 

method

=“POST” 

action

=“testsvr.php”>

摆放控件(文本框、单选按钮、复选框等)。
摆放

提交

按钮,和

重置

按钮。

<

input name

=“submit” 

type

 =“

submit

” 

value

=“

提交 >

<

input name

=“reset” 

type

 =“

reset

” 

value

=“ 

置 (将控件值设置成初值)