在我这里测试没有问题 你要是不行把代码该成这样试试 <%@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") if name1<>"" and pwd1<>"" then 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 %>
<script language=javascript> alert('请输入正确的用户名或密码'); history.back(); </script> <%
else rsc.open "update admin set admin='"&name2&"' and pwd='"&pwd2&"'",conn,3,1 %> <script language=javascript> alert("修改成功") </script>
<% end if end if %> <!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> </body> </html>