<!--#include file="conn.asp" -->
<!--#include file="md5.asp" -->
<%
Set SysRs = Server.CreateObject("ADODB.Recordset")
sql="select * from Admin"
SysRs.open sql,conn,3,3
if md5(trim(request.Form("old")),16)<>SysRs("password") then
response.write "<script language='javascript'>" & VbCRlf
response.write "alert('原密码有误!');" & VbCrlf
response.write "history.go(-1);" & vbCrlf
response.write "</script>" & VbCRLF
response.End
end if
if len(request.Form("pass"))<6 or len(request.Form("re_pw"))<6 then
response.write "<script language='javascript'>" & VbCRlf
response.write "alert('新密码不得少于6位!');" & VbCrlf
response.write "history.go(-1);" & vbCrlf
response.write "</script>" & VbCRLF
response.End
end if
if request.Form("pw")<>request.Form("re_pw") then
response.write "<script language='javascript'>" & VbCRlf
response.write "alert('两次输入的新密码不一致!');" & VbCrlf
response.write "history.go(-1);" & vbCrlf
response.write "</script>" & VbCRLF
response.End
end if
SysRs("password")=md5(trim(request.Form("pass")),16)
SysRs.update
response.write "<script language='javascript'>" & VbCRlf
response.write "alert('密码修改成功!');" & VbCrlf
response.write "location.href='modify_pw.asp';" & vbCrlf
response.write "</script>" & VbCRLF
response.End
%>
这是conn.asp代码
<%
db="data/db1.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
%>