复制代码 代码如下:
<html>
<head>
<title>Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form action="post.php" method="get">
<table cellpadding="0" cellspacing="0">
<tr>
<td><div>姓名:</div></td>
<td><input type="text"></td>
</tr>
<tr>
<td><div>密码:</div></td>
<td><input type="password"></td>
</tr>
<tr>
<td><div>密码确认:</div></td>
<td><input type="password"></td>
</tr>
<tr>
<td><div>性别:</div></td>
<td><select>
<option value="0" selected>男</option>
<option value="1">女</option>
</select></td>
</tr>
<tr>
<td><div>生日:</div></td>
<td><input type="text"></td>
</tr>
<tr>
<td><div>E-mail:</div></td>
<td><input type="text"></td>
</tr>
<tr>
<td><div>职业:</div></td>
<td><input type="text"></td>
</tr>
</table>
<p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</p>
</form>
</body>
</html>
复制代码 代码如下:
<?php
//本程序用于接收来自HTML页面的表单数据,并输出每个字段
echo "用户的输入如下所示:<BR>";
echo "姓名:".$_GET['username']."<BR>";
echo "密码:".$_GET['password']."<BR>";
echo "密码确认:".$_GET['password2']."<BR>";
echo "性别:".$_GET['sex']."<BR>";
echo "生日:".$_GET['birthday']."<BR>";
echo "E-mail:".$_GET['email']."<BR>";
echo "职业:".$_GET['job']."<BR>";
?>
复制代码 代码如下:
<?php
//本程序用于接收来自HTML页面的表单数据,并输出每个字段
echo "用户的输入如下所示:<BR>";
echo "姓名:".$_POST['username']."<BR>";
echo "密码:".$_POST['password']."<BR>";
echo "密码确认:".$_POST['password2']."<BR>";
echo "性别:".$_POST['sex']."<BR>";
echo "生日:".$_POST['birthday']."<BR>";
echo "E-mail:".$_POST['email']."<BR>";
echo "职业:".$_POST['job']."<BR>";
?>
您可能感兴趣的文章: