无敌大炮 发表于 2008-11-22 22:50:26

网页修改中文名字提示

网页修改中文名字提示一叫角色只能修改一次
请问怎么解决啊,谢谢

ctgwglzc 发表于 2008-11-24 17:12:24

把你程序放上来看看

jiji0513 发表于 2008-11-25 13:34:40

請問....有法改中文名子的網站程序有人分享嗎???

无敌大炮 发表于 2008-11-26 21:18:46

<%@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>&nbsp;</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>&nbsp;</td>
          <td>&nbsp;</td>
      </tr>
      <tr>
          <td>密码:</td>
          <td><input name="psw" type="text" id="psw" /></td>
      </tr>
      <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
      </tr>
      <tr>
          <td>原角色名称: </td>
          <td><input name="username" type="text" id="username" /></td>
      </tr>
      <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
      </tr>
      <tr>
          <td>新角色名称:</td>
          <td><input name="rusername" type="text" id="rusername" /></td>
      </tr>
      <tr>
          <td>&nbsp;</td>
          <td>(不要含有特殊符号,修改前保证人物已经下线,并没有团)</td>
      </tr>
      <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
      </tr>
      <tr>
          <td>&nbsp;</td>
          <td><input type="submit" name="Submit" value="提交" /></td>
      </tr>
      </table>
    </form></td>
</tr>
<tr>
    <td>&nbsp;</td>
</tr>
<tr>
    <td>&nbsp;</td>
</tr>
<tr>
    <td>&nbsp;</td>
</tr>
<tr>
    <td><div align="center"></div></td>
</tr>
</table>
</body>
</html>

jiji0513 发表于 2008-11-26 21:23:15

感謝大大你喔^^"

lz2006 发表于 2008-12-14 11:08:50

对,怎么解决呢?

lz2006 发表于 2008-12-14 11:15:36

我和他一样从未改过
但是出现了这样提示!

hhbwzh 发表于 2009-1-6 19:53:55

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
删掉这个就可以了...虽然现在知道.
页: [1]
查看完整版本: 网页修改中文名字提示