<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<?php
if(isset($_POST['action']) && $_POST['action']=='submitted')
{
echo "<pre>";
print_r($_POST);
echo '<a href="'. $_SERVER['PHP_SELF'] .'">返回重填</a>';
echo "</pre>";
}else
{
?>
<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<table width="500" align="center" border="1" rules="all" bordercolor="#ccc" cellpadding="5">
<tr>
<td width="100" align="center">用户名</td>
<td><input type="text" name="username"/></td>
</tr>
<tr>
<td width="100" align="center">密码</td>
<td><input type="password" name="userpwd"/></td>
</tr>
<tr>
<td width="100" align="center">住址</td>
<td>
<select name="city">
<option value="北京市 " selected="selected">北京市 </option>
<option value="天津市">天津市</option>
<option value="上海市">上海市</option>
<option value="山西省">山西省</option>
</select>
</td>
</tr>
<tr>
<td width="100" align="center">性别</td>
<td>
<input type="radio" name="sex" value="男" selected="selected" />男
<input type="radio" name="sex" value="女" />女
</td>
</tr>
<tr>
<td width="100" align="center">爱好</td>
<td>
<input type="checkbox" name="like" value="运动" />运动
<input type="checkbox" name="like" value="音乐" />音乐
<input type="checkbox" name="like" value="读书" />读书
<input type="checkbox" name="like" value="游戏" />游戏
<input type="checkbox" name="like" value="美食" />美食
<input type="checkbox" name="like" value="逛街" />逛街
</td>
</tr>
<tr>
<td width="100" align="center">自我简介</td>
<td>
<textarea name="introduce" cols="40" rows="15">
</textarea>
</td>
</tr>
<tr>
<td><input type="submit" value="提交表单" /></td>
<td><input type="reset" value="重新填写"/></td>
</tr>
<input type="hidden" name="action" value="submitted"/>
</table>
</form>
<?php } ?>
</body>
</html>
獵遍天下