www.gusucode.com > 艺帆全站DIV+CSS体育用品公司网站源码 1.7.5源码程序 > member/updata_password.asp

    <!--#include file="../Conn.asp" -->
<!--#include file="md5.Asp" -->
<% 
dim u,i,letters,id,userpassword,userpassword2
id=request("id")
userpassword=request.form("userpassword")
userpassword2=request.form("userpassword2")
	if id="" or not isnumeric(id) then
Response.Write "<script>alert('参数错误!');history.go(-1);</script>" 
	Response.End()
	end if
	if userpassword="" or userpassword2="" then
response.write "<script>alert('密码不能为空!!');history.go(-1);</script>"  
response.end 
end if
if userpassword<>userpassword2 then 
response.write "<script>alert('两次密码输入不一致,请重新输入!');history.go(-1);</script>"  
response.end 
end if
letters="0123456789abcdefghijklmnopqrstuvwxyz" 
userpassword=Lcase(trim(Request.Form("userpassword"))) 
for i=1 to len(userpassword) 
u=mid(userpassword,i,1) 
if Instr(letters,u)=0 then 
response.write "<script>alert('登陆密码只能由字母、数字及下划线组成!');history.go(-1);</script>" 
response.end 
end if 
next 
if len(userpassword)<6 or len(userpassword)>20 then   
response.write "<script>alert('密码必须为6至20位!');history.go(-1);</script>" 
response.end 
end if 
	SQL="Select * from [user] where id="&id
	set rs=server.createobject("adodb.recordset")
	rs.open SQL,conn,1,3
	if rs.eof and rs.bof then
Response.Write "<script>alert('参数不正确,ID值不存在!');history.go(-1);</script>" 
	Response.End()
	end if
rs("userpassword")=md5(request.form("userpassword"))
rs.update 
rs.close 
response.write "<script>alert('密码修改成功!');window.location.href='xiugai_password.asp';</script>" 

%>