表单中的值怎么传递啊?
这是denglu.asp的代码,下面的代码可以执行,但是怎么让表单中UserName的值在main.asp中显示,两个表分别该加什么语句啊?具体的
<head>
<%
flag=request.QueryString("flag")
dim UserName,UserPwd
if len(flag)>0 then
UserName=request.Form("UserName")
UserPwd=request.Form("UserPwd")
if len(UserName)>0 and len(UserPwd)>0 then
dim conn,rs
set conn=server.CreateObject("adodb.connection")
conn.open"dsn=Discuss;uid=sa;pwd=sa"
strSql="SELECT * FROM Users WHERE UserName='"&UserName&"' AND UserPwd='"&UserPwd&"'"
set rs=conn.execute(strSql)
if Not rs.eof then
session("UserId")=rs("UserId")
session("Passed")=true
conn.close: set conn=nothing
if (UserName="admin") then
response.Redirect("manage.asp")
response.end
else
response.Redirect("main.asp")
response.End
end if
else
Errmsg="用户名或密码错误!"
end if
end if
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript" >
function $(UserId){return document.getElementById(UserId);}
function chkfield1(){
if ($("UserName").value==""){
alert("请输入用户名!");$("UserName").focus();
return false;}
if ($("UserPwd").value==""){
alert("请输入密码!");$("UserPwd").focus();
return false;}
}
</script>
</head>
<body>
<br><br>
<p align="center"><font color="#990033" size="15" face="隶书">身份验证</font></p>
<hr color="#993300" width="50%" />
<p align="center"><font color="#FF0000"><%=Errmsg%></font></p>
<form method="post" action="denglu.asp?flag=1"name="denglu" onsubmit="return chkfield1()">
<br>
<table id="table2" align="center">
<tr>
<td><p align="center">用户名:</td>
<td><p align="center"><input type="text" name="UserName" size="20"><td>
</tr>
<tr>
<td><p align="center">密 码:</td>
<td><input type="password" name="UserPwd" size="21"></td>
</tr>
<tr>
<td><p align="center"><input type="submit" value="确定" name="B1"></td>
<td><p align="center"><input type="reset" value="重写" name="B2"></td>
</table></form>
<form method="post" action="zhuce.asp"name="zhuce"><center>
<input type="submit" value="注册新用户" name="B3"></center>
</form>
</body&g