处理用的文件代码
<!--#include file="conn.asp" -->
MX
aik+2
<%
MX
aik+2
Dim URL
MX
aik+2
If DateDiff("s",Request.Cookies("KevanTM")("vitistime"),Now())<2 Then
MX
aik+2
URL=Request.ServerVariables("Http_REFERER")
MX
aik+2
Response.Write("<meta http-equiv=""refresh"" content=""2;URL="&URL&""">")
MX
aik+2
Response.Write("网站启动页面防刷新功能,两秒后自动跳转......")
MX
aik+2
Response.end
MX
aik+2
End IF
MX
aik+2
Response.Cookies("KevanTM")("vitistime")=Now()
MX
aik+2
%>
MX
aik+2
<%
MX
aik+2
if not instr(1,Request.ServerVariables("http_Referer"),Request.ServerVariables ("SERVER_NAME"),1)=8 then
MX
aik+2
response.write "<b>请不要从非本服务器的页面提交信息</b>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
ps_loginname=trim(request.form("id_loginid"))
MX
aik+2
charname=trim(request.form("charname"))
MX
aik+2
charname1=left(trim(request.form("charname1")),6)
MX
aik+2
password=trim(request.form("password"))
if instr(ps_loginname,"'")<>0 or instr(ps_loginname,"=")<>0 or instr(ps_loginname,"&")<>0 or instr(ps_loginname,"%")<>0 then
MX
aik+2
response.write "<script language=javascript>alert('您输入的用户名不符合要求!');history.back();</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
if instr(charname,"'")<>0 or instr(charname,"=")<>0 or instr(charname,"&")<>0 or instr(charname,"%")<>0 then
MX
aik+2
response.write "<script language=javascript>alert('您输入的用户名不符合要求!');history.back();</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
if charname = charname1 then
MX
aik+2
response.write "<script language=javascript>alert('您输入的用户名不符合要求!');history.back();</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
if len(charname) > 16 then
MX
aik+2
response.write "<script language=javascript>alert('您设定的用户名太长,服务器不能接受!');history.back();</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
if len(charname1) > 16 then
MX
aik+2
response.write "<script language=javascript>alert('您设定的用户名太长,服务器不能接受!');history.back();</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
if instr(charname1,"'")<>0 or instr(charname1,"=")<>0 or instr(charname1,"&")<>0 or instr(charname1,"%")<>0 or instr(charname1,"*")<>0 then
MX
aik+2
response.write "<script language=javascript>alert('您输入的用户名不符合要求!');history.back();</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
if password="" then
MX
aik+2
response.write "<script language=javascript>alert('请您输入密码!');history.back();</script>"
MX
aik+2
response.end
MX
aik+2
end if
set rs1 = Server.CreateObject("ADODB.Recordset")
MX
aik+2
sql="select * from chr_log_info where id_loginid = '"&ps_loginname&"'"
rs1.open sql,dbconn,1,1
if rs1.eof then
response.write "<script language=JavaScript>" & chr(13) & "alert('用户名不存在');" & "history.back()" & "</script>"
MX
aik+2
response.end
else
MX
aik+2
if rs1("id_passwd")<>password then
MX
aik+2
response.write "<script language=JavaScript>" & chr(13) & "alert('您的原始密码错误!');" & "history.back()" & "</script>"
MX
aik+2
response.end
MX
aik+2
else
MX
aik+2
editid=rs1("propid")
MX
aik+2
rs1.close
MX
aik+2
set rs1=nothing
'检测账号是否在线
MX
aik+2
set rs10 = Server.CreateObject("ADODB.Recordset")
MX
aik+2
sql="select * from logintable where user_id = '"&ps_loginname&"'"
MX
aik+2
rs10.open sql,dbconn,1,1
MX
aik+2
if not rs10.eof then
MX
aik+2
response.write "<script language=JavaScript>" & chr(13) & "alert('角色在线无法更改名字!');" & "history.back()" & "</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
rs10.close
MX
aik+2
set rs10=nothing
'检测结束
MX
aik+2
'===============================================================================
MX
aik+2
if charname<>"" then
MX
aik+2
'----------------------------角色更名功能-------------------------------
MX
aik+2
'先检测一下想改的名字是否已经被占用
MX
aik+2
set rs9 = Server.CreateObject("ADODB.Recordset")
MX
aik+2
sql9="select * from charname_1 where charname='"&charname1&"'"
MX
aik+2
rs9.open sql9,dbconn,1,1
MX
aik+2
'检测用户名是否已经存在
MX
aik+2
if not rs9.bof then
MX
aik+2
response.write "<script language=JavaScript>" & chr(13) & "alert('对不起角色名字已经被占用了!');" & "history.back()" & "</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
rs9.close
MX
aik+2
set rs9=nothing
MX
aik+2
'检测结束
MX
aik+2
set rs = Server.CreateObject("ADODB.Recordset")
MX
aik+2
sql="select * from charname_1 where propid="&editid&" and charname='"&charname&"'"
MX
aik+2
rs.open sql,dbconn,1,1
MX
aik+2
if rs.bof then
MX
aik+2
response.write "<script language=JavaScript>" & chr(13) & "alert('对不起你想改的角色名字不存在!');" & "history.back()" & "</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
editids=rs("charpropid")
MX
aik+2
rs.close
MX
aik+2
set rs=nothing
MX
aik+2
'更改角色表名字开始
MX
aik+2
set rs = Server.CreateObject("ADODB.Recordset")
MX
aik+2
sql1="select * from CharInfo where charPropID="&editids&""
MX
aik+2
rs.open sql1,conn,1,3
MX
aik+2
if not rs.bof then
MX
aik+2
if rs("Lv") > 3 then
MX
aik+2
response.write "<script language=JavaScript>" & chr(13) & "alert('对不起只允许战斗等级三级以前的角色更改名字!');" & "history.back()" & "</script>"
MX
aik+2
response.end
MX
aik+2
end if
'如果检测无误就开始更改两个表里面的角色名称
MX
aik+2
rs("charname")=charname1
MX
aik+2
rs("Expr1")=charname1
MX
aik+2
rs.update
MX
aik+2
rs.close
MX
aik+2
set rs=nothing
MX
aik+2
'更改charname_1表中的名字
MX
aik+2
set rs7 = Server.CreateObject("ADODB.Recordset")
MX
aik+2
sql7="select * from charname_1 where propid="&editid&" and charname='"&charname&"'"
MX
aik+2
rs7.open sql7,dbconn,1,3
MX
aik+2
rs7("charname")= charname1
MX
aik+2
rs7.update
MX
aik+2
rs7.close
MX
aik+2
set rs7=nothing
MX
aik+2
else
MX
aik+2
response.write "<script language=JavaScript>" & chr(13) & "alert('您输入的角色名称不存在!');" & "history.back()" & "</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
rs.close
MX
aik+2
set rs=nothing
'----------------------------角色更名功能-------------------------------
MX
aik+2
end if
MX
aik+2
'===============================================================================
dbconn.close
MX
aik+2
set dbconn=nothing
MX
aik+2
conn.close
MX
aik+2
set conn=nothing
MX
aik+2
response.write "<script language=JavaScript>" & chr(13) & "alert('更名成功!');" & "history.back()" & "</script>"
MX
aik+2
response.end
MX
aik+2
end if
MX
aik+2
end if
MX
aik+2
%>