[求助]如何在同一个窗口做修改密码和验证
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%if isempty(session("username")) then
response.redirect("login.asp")
end if
name1=request("oldname")
pwd1=request("pwd1")
name2=request("newname2")
pwd2=request("newpwd2")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/my.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理员密码修改</title>
</head>
<body>
<form name="form1" method="post" action="change.asp">
<table width="424" height="220" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#993300" class="k1">
<tr>
<td width="420" height="18" bgcolor="#FFFFFF"><a href="index.asp">发表留言</a>||<a href="change.asp">管理员资料修改</a>||<a href="loginout.asp">退出管理</a></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td width="37%">旧用户名:</td>
<td width="63%">
<div align="justify">
<input name="oldname" type="text" class="k1" size="20">
</div></td>
</tr>
<tr align="center">
<td>旧 密 码:</td>
<td>
<div align="justify">
<input name="oldpwd" type="password" class="k1" value="" size="20">
</div></td>
</tr>
<tr align="center">
<td>新用户名:</td>
<td>
<div align="justify">
<input name="newname" type="text" class="k1" size="20">
</div></td>
</tr>
<tr align="center">
<td>新 密 码:</td>
<td>
<div align="justify">
<input name="newpwd" type="password" class="k1" id="newpwd" size="20">
</div></td>
</tr>
<tr align="center">
<td>确认密码:</td>
<td>
<div align="justify">
<input name="newpwd" type="password" class="k1" id="newpwd" size="20">
</div></td>
</tr>
<tr align="center">
<td height="26"><input name="Submit" type="submit" class="k1" value="修改"></td>
<td>
<input name="Submit" type="reset" class="k1" value="重置">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<%
set rsc=server.createobject("adodb.recordset")
sqlc="select * from admin where admin='"&name1&"' and pwd='" &pwd&"'"
rsc.open sqlc,conn,3,2
if rsc.eof or rsc.bof then
response.write("<script>alert('请输入正确的用户名或密码');history.back()</script>")
else
rsc.open "update admin set admin='"&name2&"' and pwd='"&pwd2&"'",conn,3,1
end if
%>
</body>
</html>
如何在同一个窗口做修改密码和验证,当我进入这个窗口时他说会使用
response.write("<script>alert('请输入正确的用户名或密码');history.back()</script>")
我是想提交后使用的,请高手帮帮我,我试了好几次都不行。