<%@ LANGUAGE=VBScript codepage ="936" %>
<!--#include file="../pass.asp"-->
<%Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
myid=Request.form("id")
name=request.form("name")
pass=trim(request.form("pass"))
for each element in Request.Form
if instr(element,"'")<>0 or instr(element,"|")<>0 or instr(element," ")<>0 or instr(Request.Form(element),"'")<>0 or instr(Request.Form(element)," ")<>0 or instr(Request.Form(element),"|")<>0 then 
		Response.Write "<script Language=Javascript>alert('提示：输入数据有问题，请查看！');location.href = 'javascript:history.go(-1)';</script>"
		Response.End
end if
next
if name="" or pass="" then
		Response.Write "<script Language=Javascript>alert('提示：是不是不想报仇血恨了？连用户和密码都不填！');location.href = 'javascript:history.go(-1)';</script>"
		Response.End
end if
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
pass=md5(pass)
rs.open "select * from 用户 where id="& myid &" and 姓名='" & name & "'",conn
if rs.eof or rs.bof then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script Language=Javascript>alert('提示：有没有搞错？哪有这个人啊？');location.href = 'javascript:history.go(-1)';</script>"
	Response.End
end if
if trim(pass)<>rs("密码") then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script Language=Javascript>alert('提示：输入登录密码不对！！');location.href = 'javascript:history.go(-1)';</script>"
	Response.End
end if
if rs("体力")>-100 and rs("状态")<>"死" then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script Language=Javascript>alert('提示：有没有搞错？该用户还没死啊？？');location.href = 'javascript:history.go(-1)';</script>"
	Response.End
end if
if rs("状态")<>"死" and rs("状态")<>"正常" then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<script Language=Javascript>alert('提示：此人被系统监禁中……');location.href = 'javascript:history.go(-1)';</script>"
	Response.End
end if
	'会员等级判断
	if rs("会员等级")>=1 then
		conn.execute("update 用户 set 状态='正常',体力=1000,保护=true where 姓名='"&name&"'")
		Response.Write "<script Language=Javascript>alert('OK,您是会员，所以您复活了什么也没有丢。国度危险，要小心!');</script>"
	else
		conn.execute("update 用户 set 状态='正常',体力=1000,内力=1000,银两=10000,保护=true where 姓名='"&name&"'")
			Response.Write "<script Language=Javascript>alert('OK,您现在已经复活了，体力=1000,内力=1000,银两=10000。\n如果您是会员不会有任何损失!');</script>"
	end if
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Write "<script Language=Javascript>alert('恭喜大侠，你成功的复活了!记住，你一定要报仇啊!');location.href = '../index.asp';</script>"
%>