主题:asp修改密码
<%@ LANGUAGE = VBScript %>
<!--#include file="asp/sqlstr.asp"-->
<!--#include file="asp/opendb.asp"-->
<%
'-----------------------------------------
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then
response.write("<script language=""javascript"">")
response.write("window.top.location.href='default.asp';")
response.write("</script>")
response.end
end if
'--------------------------------------
%>
<html>
<body>
<p>请提供以下信息,然后单击提交。
<p>姓名:<input name="username" size="36" value="<%=request.cookies("oabusyusername")%>" />
<p>密码:<input password="password" type=password size="36">
<p>新密码:<input newpassword="newpassword" type=password size="36">
<p><input type=submit value="提交"><input type=reset value="清除">
</form>
<%
if request.form("submit") = "提交" then
username=request.Form("username")
password=request.form("password")
newpassword=request.form("newpassword")
username=session("username")
if newpassword<>"" then
if newpassword=password then
sql="select * from userinf where username='"&username&"'"
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs("password")=newpassword
rs.update
rs.close
set rs=nothing
Response.Write("alert('密码修改成功!')")
else
response.write("alert('密码不相同')")
end if
else
response.write("alert('密码框不能为空')")
end if
end if
%>
</body>
</html>
哪位大虾帮忙看看这段代码,提交按钮不执行
<!--#include file="asp/sqlstr.asp"-->
<!--#include file="asp/opendb.asp"-->
<%
'-----------------------------------------
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then
response.write("<script language=""javascript"">")
response.write("window.top.location.href='default.asp';")
response.write("</script>")
response.end
end if
'--------------------------------------
%>
<html>
<body>
<p>请提供以下信息,然后单击提交。
<p>姓名:<input name="username" size="36" value="<%=request.cookies("oabusyusername")%>" />
<p>密码:<input password="password" type=password size="36">
<p>新密码:<input newpassword="newpassword" type=password size="36">
<p><input type=submit value="提交"><input type=reset value="清除">
</form>
<%
if request.form("submit") = "提交" then
username=request.Form("username")
password=request.form("password")
newpassword=request.form("newpassword")
username=session("username")
if newpassword<>"" then
if newpassword=password then
sql="select * from userinf where username='"&username&"'"
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs("password")=newpassword
rs.update
rs.close
set rs=nothing
Response.Write("alert('密码修改成功!')")
else
response.write("alert('密码不相同')")
end if
else
response.write("alert('密码框不能为空')")
end if
end if
%>
</body>
</html>
哪位大虾帮忙看看这段代码,提交按钮不执行