商城积分兑换(asp版)

来源:互联网 发布:单片机汇编setb 编辑:程序博客网 时间:2024/04/27 15:53
dim userId,proScoreproScore=Request.QueryString("proScore")userId=Session("userId")if userId="" or isEmpty(userId) or isNull(userId) ThenResponse.Write("请您先登录,谢谢!")Response.End()elseif isNumeric(userId)=False thenResponse.Write("无效的用户ID!")Response.End()end ifend ifif proScore="" thenResponse.Write("兑换积分不能为空!")Response.End()elseif isNumeric(proScore)=False thenResponse.Write("无效的兑换积分!")Response.End()elseproScore=CInt(proScore)end ifend ifsql="select jf from [mp_User] where id="&userIdset rs = Server.CreateObject("adodb.recordset")rs.Open sql,conn,1,1if not rs.EOF Thenif rs("jf")<>0 thenif rs("jf")>proScore thenconn.Execute("update mp_User set jf=jf-"&proScore&" where id="&userId)elseResponse.Write("sorry,您的积分不够!")end ifelseResponse.Write("该用户还未有积分!")end ifelseResponse.Write("该用户不存在!")end ifrs.closeset rs=nothingcloseconn 
原创粉丝点击