only 发表于 2009-1-7 13:50:32

请教ASP那一段是设2转扣除的钱

<!--#include file="conn.asp" -->

<%
n=request.form("username")

if instr(n,"'")<>0 then response.end
if instr(n,"=")<>0 then response.end
if instr(n,"%")<>0 then response.end

if n<>"" then
set rs1 = Server.CreateObject("ADODB.Recordset")
sql="select * from USERDATA where strUserId='"&n&"' and <>210"
rs1.open sql,conn,1,3
if rs1.eof or rs1.bof then
response.write "<script language=javascript>alert('对不起,您不符合转职条件或已经二转过了。');history.back()</script>"
response.end

end if
if rs1("class")<rfs then
response.write "<script language=javascript>alert('对不起,您的职业并不是人族一转法师!');history.back()</script>"
end if
if rs1("class")>rfs2 then
response.write "<script language=javascript>alert('对不起,您的职业并不是人族一转法师!');history.back()</script>"
end if
if rs1("Gold")<hongmingxiaoqian then
response.write "<script language=javascript>alert('对不起,你身上骑士币不足"&hongmingxiaoqian&"。');history.back()</script>"
end if
if rs1("level")<level then
response.write "<script language=javascript>alert('等级不足60级,不能进行转职。');history.back()</script>"

else
rs1("Gold")=rs1("Gold")-hongmingxiaoqian
rs1("Class")=210
rs1.update

response.write "<script language=javascript>alert('你现在成功二转了,系统已扣除你"&hongmingxiaoqian&"骑士币为转职费用!');history.back()</script>"
response.end
end if
else
%>

<LINK href="images/mu.css" rel=stylesheet type=text/css>
<style type="text/css">
<!--
body {
        background-color: #F3EADB;
}
.STYLE1 {color: #660099}
.STYLE3 {color: #009999}
-->
</style>
<FORM method=post name=chgform action="rfs.asp">
<TABLE align=center border=0 cellPadding=5 cellSpacing=1 width="500">
            <TR>
                <TD align=right class=txt_gray width="150">
                <font color="#ff0000"><b>人族&nbsp;法师&nbsp;二转 ===></b></font>
               </TD>

                <TD align=right class=txt_gray width="50">
<font color="#ff0000">角色名称</font></TD>
                <TD class=txt_gray width="100">
                <INPUT maxLength=12 name=username size=17>
</TD>
          <TD width="100"><A href="javascript:document.chgform.submit()"><IMG border=0 src="image/qd.gif"></A>
          </TD></TR></TABLE></FORM>
<%end if%>

hhbwzh 发表于 2009-1-7 14:04:24

你这个好像没啊

hhbwzh 发表于 2009-1-7 14:09:26

Config.asp 你打开这个,在这里设置的

tianwei76 发表于 2009-1-7 14:17:23

楼上正解~~全中文提示,应该很容易明白。

only 发表于 2009-1-7 15:53:29

谢谢解决问题
页: [1]
查看完整版本: 请教ASP那一段是设2转扣除的钱