asp实现Post方法提交数据

目录

post方法主要用于大量数据传输,单独发送数据包传递

主要利用Request.form(“表单对象名称”)来接受数据

2个实例在下面

1_2.htm

<html>
<head>
<title>Post方法提交数据</title>
</head>
<body>
<p align="center" ><font color=red>Post方法提交数据</font></p>
<form name="bd" method="post" action="1_2.asp">
<table width="100%" border="0" cellpadding="0" cellspacing="">
<tr><td width="50%" align="right" valign="middle" height="37"><font color=red>*</font>用户名:</td>
<td width="50%" align="left" valign="middle" height="37"><input type="text" name="yh" size="17"></td></tr>
<tr><td width="50%" align="right" valign="middle" ><font color=red>*</font>密码:</td>
<td width="50%" align="left" valign="middle"><input type="password" name="mm" size="18"></td></tr>
<tr><td width="50%" align="right" valign="middle" ><font color=red>*</font>确认密码:</td>
<td width="50%" align="left" valign="middle"><input type="password" name="qm" size="18"></td></tr>
<tr><td width="50%" align="right" valign="middle" ><font color=red>*</font>姓名:</td>
<td width="50%" align="left" valign="middle"><input type="text" name="xm" size="17"></td></tr>
<tr><td width="50%" align="right" valign="middle" ><font color=red>*</font>职业:</td><td align="left" valign="middle"><select name="xl" size="1">
<option value="1">学生
<option value="2">工人
<option value="3">教师
<option value="4">工程师
</select></td>
<tr><td width="50%" align="right" valign="middle"><font color=red>*</font>E-mail地址:</td>
<td width="50%" align="left" valign="middle"><input type="text" name="em" size="17"></td></tr>
<tr><td width="50%" align="right" valign="middle"><font color=red>*</font>地址:</td>
<td width="50%" align="left" valign="middle"><input type="text" name="dz" size="17"></td></tr>
<tr><td width="50%" align="right" valign="middle"><font color=red>*</font>电话:</td>
<td width="50%" align="left" valign="middle"><input type="text" name="dh" size="17"></td></tr>
<tr><td align="right"><input type="SUBMIT" name="tj" value="提交"></td>
<td align="left"><input type="Reset" name="qx" value="取消"></td></tr>
</table
</form>
</body>
</html>

1_2.asp

<%language="vbscript"%>
<html>
<head>
</head>
<title>Post方法提交数据</title>
<body>
<% Dim a,b,c,d,e,f,g
a=Request.form("yh")
b=Request.form("mm")
c=Request.form("qm")
d=Request.form("xm")
e=Request.form("em")
f=Request.form("dz")
g=Request.form("dh")

Response.Write "用户名:"&a&"<br>"
Response.Write "密码:"&b&"<br>"
Response.Write "确认密码:"&c&"<br>"
Response.Write "姓名:"&d&"<br>"
Response.Write "职业:"&e&"<br>"
Response.Write "地址:"&f&"<br>"
Response.Write "电话:"&g&"<br>"
%>
</body>
</html>