搜索
 找回密码
 加入

网站修改中文名错误,高手请进!

lz2006 2008-12-15 13:30:17 739
代买为:


<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>人物角色名称修改</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<script language="javascript">
function check1()
{
if (form1.username.value==''||form1.rusername.value==''||form1.strid.value==''||form1.psw.value=='')
{
alert('error!');
return false;
}
else
{
if(form1.rusername.value.length>10)
{
alert('太长了!');
return false;
}
else

return true;
}
}
</script>
<%
if request.Form("submit")<>"" then
strid=TRIM(Request.Form("strid"))
psw=TRIM(Request.Form("psw"))
username=TRIM(Request.Form("username"))
rusername=TRIM(Request.Form("rusername"))
if len(rusername)>10 then
Response.write("<script>alert('输入的角色名太长了!');window.history.back();</script>")
Response.End()
end if

'==========
Sql="Select * from Account_char where strAccountID='"& strid &"' and (strcharID1='"& username &"' or strcharID2='"& username &"' or strcharID3='"& username &"')"
set ors=conn.execute(Sql)
if ors.eof then
Response.write("<script>alert('输入的信息不正确!');window.history.back();</script>")
Response.End()
end if
Sql="Select * from TB_USER where strAccountid='"& strid &"' and strpasswd='"& psw &"'"
set ors=conn.execute(Sql)
if ors.eof then
Response.write("<script>alert('输入的密码不正确!');window.history.back();</script>")
Response.End()
end if

'===============
Sql="Select * from USERDATA where struserID='" & username & "'"
set ors=conn.Execute(Sql)
if ors.eof then
Response.write("<script>alert('输入的角色名有误!');window.history.back();</script>")
Response.End()
end if
if ors("knights")<>0 then
Response.write("<script>alert('该角色未退出骑士团!');window.history.back();</script>")
Response.End()
end if
ors.close
set ors=nothing
Sql="Select * from userdata where struserID='"& rusername &"'"
set ors=conn.Execute(Sql)
if not ors.eof then
Response.write("<script>alert('输入的新角色名已经存在!');window.history.back();</script>")
Response.End()
end if
ors.close
set ors=nothing

Sql="Select * from rname where charname='"& username &"'"
set ors=conn.Execute(Sql)
if not ors.eof then
Response.write("<script>alert('一个角色只能修改一次!');window.history.back();</script>")
Response.End()
end if
ors.close
set ors=nothing


Sql="insert into rname (charname) values ('"& rusername &"')"
conn.Execute(Sql)


Sql="update ACCOUNT_CHAR set strCharID1='"& rusername &"' where strCharID1='"& username &"'"
conn.execute(Sql)
Sql="update ACCOUNT_CHAR set strCharID2='"& rusername &"' where strCharID2='"& username &"'"
conn.execute(Sql)
Sql="update ACCOUNT_CHAR set strCharID3='"& rusername &"' where strCharID3='"& username &"'"
conn.execute(Sql)
Sql="update USERDATA set strUserID='"& rusername &"' where strUserID='"& username &"'"
conn.Execute(Sql)
Response.write("<script>alert('角色名修改成功!');</script>")
end if

%>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="150"><img src="Pic/top.jpg" width="700" height="150" /></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><form id="form1" name="form1" method="post" action="" onsubmit="return check1();">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>帐号:</td>
<td><input name="strid" type="text" id="strid" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>密码:</td>
<td><input name="psw" type="text" id="psw" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>原角色名称: </td>
<td><input name="username" type="text" id="username" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>新角色名称:</td>
<td><input name="rusername" type="text" id="rusername" /></td>
</tr>
<tr>
<td> </td>
<td>(不要含有特殊符号,修改前保证人物已经下线,并没有团)</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="提交" /></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center"></div></td>
</tr>
</table>
</body>
</html>






















1个角色从未 修改过名字,但是他提示 :1个角色只能修改1次”
请问怎么修改让他不提示或者可以无限修改?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

x

4 回复

lz2006
2008-12-14 11:35:49
楼主
点击查看详情
没人知道嘛??????
lz2006
2008-12-14 11:58:16
楼主
我已经修改成功了!
panda
2008-12-14 23:00:50
通过存储过程来做,你这个不全,骑士团没考虑
chencjh
2008-12-15 13:30:17

解决放法

Sql="Select * from rname where charname='"& username &"'"
set ors=conn.Execute(Sql)
if not ors.eof then
Response.write("<script>alert('一个角色只能修改一次!');window.history.back();</script>")
Response.End()
end if
ors.close
set ors=nothing

把以上部分内容去除。。。就可以了。。可以改无数次。。
高级模式
游客