关于asp取值问题_奖励推荐人的asp代码

来源:百度知道 编辑:UC知道 时间:2024/07/07 12:34:11
<%
if Request.Form("work")="add" then
u_name=trim(Request("u_name"))
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open("select * from my_user where u_name='"&sessname&"'"),conn,1,3
if rs("u_ntb")<500 then call cnerror("积分不足,积分达到500以上才可获赠。继续努力!",1,0)
if rs("flag")>0 then call cnerror("对不起,对于此用户您已经获取过一次奖励了!",1,0)

rs("flag")=rs("flag")+1
rs.update '当被推荐人积分达到500,便奖励推荐人4个发布点
rs.close
rs1.open("select * from my_user where u_name='"&sessname&"'"),conn,1,3
if not rs1.eof and not rs1.bof then
rs1("u_fabushu")=rs1("u_fabushu")+8
rs1.update '标志已获取过赠送发布点了
end if
rs1.close
Set rs=nothing
call cnerror("您的赠送已经成功,您已经获得8发布点。")
end if
%>
表单在同一页:
<INPUT

加一个判断
rs.open("select * from my_user where u_name='"&sessname&"'"),conn,1,3
if not rs.eof and not rs.bof then
if rs("u_ntb")<500 then call cnerror("积分不足,积分达到500以上才可获赠。继续努力!",1,0)
if rs("flag")>0 then call cnerror("对不起,对于此用户您已经获取过一次奖励了!",1,0)

rs("flag")=rs("flag")+1
rs.update '当被推荐人积分达到500,便奖励推荐人4个发布点
rs.close

end if

cnerror 函数有问题,你在这里传了3个参数(提示信息,提示次数,提示方式)
可能的原因:
1、没有包含该函数!
2、该函数不存在或者接受的参数不等于3个

老大,你END IF哪去了

你是什么意思呀