搜索
 找回密码
 加入

求修改中文名的asp!

laoyou456 2008-9-17 12:59:56 1168
前面用了个 但是一修改就出现 一个角色只能修改一次  其实什么也没修改 郁闷了好久
那个大虾无私分享个 修改中文的 asp

6 回复

vvforgs
2008-9-14 22:51:53
点击查看详情
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <!--#include file="conn.asp"-->
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  7. <title>人物角色名称修改</title>
  8. <link href="css.css" rel="stylesheet" type="text/css" />
  9. </head>
  10. <script language="javascript">
  11. function check1()
  12. {
  13.         if (form1.username.value==''||form1.rusername.value==''||form1.strid.value==''||form1.psw.value=='')
  14.         {
  15.                 alert('error!');
  16.                 return false;
  17.         }
  18.         else
  19.         {
  20.                 if(form1.rusername.value.length>10)
  21.                 {
  22.                         alert('太长了!');
  23.                         return false;
  24.                 }
  25.                 else
  26.                
  27.                 return true;
  28.         }
  29. }
  30. </script>
  31. <%
  32. if request.Form("submit")<>"" then
  33.         strid=TRIM(Request.Form("strid"))
  34.         psw=TRIM(Request.Form("psw"))
  35.         username=TRIM(Request.Form("username"))
  36.         rusername=TRIM(Request.Form("rusername"))
  37.         if len(rusername)>10 then
  38.                 Response.write("<script>alert('输入的角色名太长了!');window.history.back();</script>")
  39.                 Response.End()
  40.         end if
  41.        
  42.         '==========
  43.         Sql="Select * from Account_char where strAccountID='"& strid &"' and (strcharID1='"& username &"' or strcharID2='"& username &"' or strcharID3='"& username &"')"
  44.         set ors=conn.execute(Sql)
  45.         if ors.eof then
  46.                 Response.write("<script>alert('输入的信息不正确!');window.history.back();</script>")
  47.                 Response.End()
  48.         end if
  49.         Sql="Select * from TB_USER where strAccountid='"& strid &"' and strpasswd='"& psw &"'"
  50.         set ors=conn.execute(Sql)
  51.         if ors.eof then
  52.                 Response.write("<script>alert('输入的密码不正确!');window.history.back();</script>")
  53.                 Response.End()
  54.         end if
  55.        
  56.         '===============
  57.         Sql="Select * from USERDATA where struserID='" & username & "'"
  58.         set ors=conn.Execute(Sql)
  59.         if ors.eof then
  60.                 Response.write("<script>alert('输入的角色名有误!');window.history.back();</script>")
  61.                 Response.End()
  62.         end if
  63.         if ors("knights")<>0 then
  64.                 Response.write("<script>alert('该角色未退出骑士团!');window.history.back();</script>")
  65.                 Response.End()
  66.         end if
  67.         ors.close
  68.         set ors=nothing
  69.         Sql="Select * from userdata where struserID='"& rusername &"'"
  70.         set ors=conn.Execute(Sql)
  71.         if not ors.eof then
  72.                 Response.write("<script>alert('输入的新角色名已经存在!');window.history.back();</script>")
  73.                 Response.End()
  74.         end if
  75.         ors.close
  76.         set ors=nothing
  77.        
  78.         Sql="Select * from rname where charname='"& username &"'"
  79.         set ors=conn.Execute(Sql)
  80.         if not ors.eof then
  81.                 Response.write("<script>alert('一个角色只能修改一次!');window.history.back();</script>")
  82.                 Response.End()
  83.         end if
  84.         ors.close
  85.         set ors=nothing
  86.        
  87.        
  88.         Sql="insert into rname (charname) values ('"& rusername &"')"
  89.         conn.Execute(Sql)
  90.        
  91.        
  92.         Sql="update ACCOUNT_CHAR set strCharID1='"& rusername &"' where strCharID1='"& username &"'"
  93.         conn.execute(Sql)
  94.         Sql="update ACCOUNT_CHAR set strCharID2='"& rusername &"' where strCharID2='"& username &"'"
  95.         conn.execute(Sql)
  96.         Sql="update ACCOUNT_CHAR set strCharID3='"& rusername &"' where strCharID3='"& username &"'"
  97.         conn.execute(Sql)
  98.         Sql="update USERDATA set strUserID='"& rusername &"' where strUserID='"& username &"'"
  99.         conn.Execute(Sql)
  100.         Response.write("<script>alert('角色名修改成功!');</script>")
  101. end if

  102. %>
  103. <body>
  104. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  105.   <tr>
  106.     <td height="150"><img src="Pic/top.jpg" width="700" height="150" /></td>
  107.   </tr>
  108.   <tr>
  109.     <td>&nbsp;</td>
  110.   </tr>
  111.   <tr>
  112.     <td><form id="form1" name="form1" method="post" action="" onsubmit="return check1();">
  113.       <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  114.         <tr>
  115.           <td>帐号:</td>
  116.           <td><input name="strid" type="text" id="strid" /></td>
  117.         </tr>
  118.         <tr>
  119.           <td>&nbsp;</td>
  120.           <td>&nbsp;</td>
  121.         </tr>
  122.         <tr>
  123.           <td>密码:</td>
  124.           <td><input name="psw" type="text" id="psw" /></td>
  125.         </tr>
  126.         <tr>
  127.           <td>&nbsp;</td>
  128.           <td>&nbsp;</td>
  129.         </tr>
  130.         <tr>
  131.           <td>原角色名称: </td>
  132.           <td><input name="username" type="text" id="username" /></td>
  133.         </tr>
  134.         <tr>
  135.           <td>&nbsp;</td>
  136.           <td>&nbsp;</td>
  137.         </tr>
  138.         <tr>
  139.           <td>新角色名称:</td>
  140.           <td><input name="rusername" type="text" id="rusername" /></td>
  141.         </tr>
  142.         <tr>
  143.           <td>&nbsp;</td>
  144.           <td>(不要含有特殊符号,修改前保证人物已经下线,并没有团)</td>
  145.         </tr>
  146.         <tr>
  147.           <td>&nbsp;</td>
  148.           <td>&nbsp;</td>
  149.         </tr>
  150.         <tr>
  151.           <td>&nbsp;</td>
  152.           <td><input type="submit" name="Submit" value="提交" /></td>
  153.         </tr>
  154.       </table>
  155.     </form></td>
  156.   </tr>
  157.   <tr>
  158.     <td>&nbsp;</td>
  159.   </tr>
  160.   <tr>
  161.     <td>&nbsp;</td>
  162.   </tr>
  163.   <tr>
  164.     <td>&nbsp;</td>
  165.   </tr>
  166.   <tr>
  167.     <td><div align="center"></div></td>
  168.   </tr>
  169. </table>
  170. </body>
  171. </html>
复制代码

评分

1

查看全部评分

laoyou456
2008-9-15 00:04:42
楼主
谢谢啊 好人还是多纳
laoyou456
2008-9-15 00:14:53
楼主
用了上面的代码 还是那样子 问题出在哪了 望高手指点迷津


一输入完修改信息 点击后就出现    一个角色只能修改一次
feike
2008-9-17 10:45:49
服务器地址指向是不是在此定义:
<!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">
binwang
2008-9-17 11:07:13
原帖由 feike 于 2008-9-17 02:45 发表
服务器地址指向是不是在此定义:


no
这个是定义这个页面用的是w3c的transitional标准
laoyou456
2008-9-17 12:59:56
楼主
哎~~~!
高级模式
游客