| 发表于:2008-01-20 01:02:28 楼主 |
以下是判断代码???好心朋友直接帮我改一下。好吗? <table width="760" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor= <%=bgclr2%> > <form name="form1" method="post" action=""> <tr bgcolor= <%=bgclr1%> align="center" height="20"> <td align="left"> 商品名称 </td> <td width="8%"> 市场价 </td> <td width="8%"> 会员价 </td> <td width="8%"> 成交价 </td> <td width="5%"> 邮费 </td> <td width="4%"> 数量 </td> <td width="6%"> 积分 </td> <td width="9%"> 小计 </td> <td width="8%"> 操作 </td> </tr> <% set rs=server.createobject("adodb.recordset") rs.open "select id,name,price1,price2,vipprice,amount,discount,score,stock from sia_product where id in ("&id&")",conn,1,1 sum1=0 sums1=0 bookscount=formatsql(request.querystring("id").count) do while not rs.eof quatity = cint( request.form( "shop"&rs("id")) ) if quatity <=0 then quatity = 1 if rs("stock") <quatity then response.write " <script language=javascript> alert('对不起,"&rs("name")&"商品已售完,请过段时间再来购买!');history.go(-1); </script> " else strscore=rs("score") strprice1=rs("price1") strprice2=rs("price2") strvipprice = rs("vipprice") if rs("amount") = 0 then yourprice = strprice2 else yourprice = strprice2*lngdiscount end if %> <tr bgcolor= <%=bgclr3%> align="center"> <td style='padding-left: 5px' align="left"> <%=trim(rs("name"))%> <input type=hidden name=name value= <%=trim(rs("name"))%> > </td> <td > <% = strprice1 %> 元 </td> <input type=hidden name=price1 value= <% = strprice1 %> > <td> <% = strprice2 %> 元 </td> <input type=hidden name=price2 value= <% = strprice2 %> > <td> <% =yourprice %> 元 </td> <td> <% =strvipprice %> 元 </td> <td> <input name=" <%="shop"& rs("id")%> " type="text" size="1" value=" <%=quatity%> " onkeypress= "return reginput(this, /^[0-9]*$/, string.fromcharcode(event.keycode))"onpaste = "return reginput(this,/^[0-9]*$/, window.clipboarddata.getdata('text'))"ondrop= "return reginput(this,/^[0-9]*$/,event.datatransfer.getdata('text'))"> </td> <td> <% if quatity <=1 then %> <%=strscore%> 分 <% else %> <%=strscore*quatity %> 分 <% end if sums1=strscore*quatity+sums1 %> </td> <td> <% if quatity <=1 then %> <%=round((yourprice+strvipprice),2) %> 元 <% else %> <%=round((yourprice+strvipprice)*quatity,2) %> 元 <% end if sum1=(yourprice+strvipprice)*quatity+sum1 %> </td> <td align="center"> <input type="submit" name="submit" value="修改" onclick="this.form.action='cart.asp?id= <%=id%> ';this.form.submit()"> </td> </tr> <% end if if bookscount=1 then books=rs("id") rs.movenext loop rs.close set rs=nothing 'conn.close 'set conn = nothing %> <tr bgcolor= <%=bgclr3%> height="20"> <td colspan="10"> 你是 <font color="#ff6600"> <%= strtitle %> </font> 享受折扣 <font color="#ff6600"> <% = lngdiscount*100&"%" %> </font> 费用总计: <font color="#ff6600"> <%=round(sum1,2) %> </font> 元,获得积分: <font color="#ff6600"> <%=sums1%> </font> 分 </font> </td> </tr> <tr bgcolor= <%=bgclr3%> > <td height="32" colspan="10" align="center"> <input type="submit" name="submit2" style="height:20; font:9pt; border-bottom: #ffffff 1px groove; border-right: #ffffff 1px groove; background-color: <% = bgclr1 %> "value="下一步" onclick="this.form.action='cart.asp?action=shop1&id= <%=id%> ';this.form.submit()" > <%if bookscount=1 then%> <input type="button" name="submit22" style="height:20; font:9pt; border-bottom: #ffffff 1px groove; border-right: #ffffff 1px groove; background-color: <% = bgclr1 %> "value="放入购物车" onclick="location.href='addto.asp?id= <%=books%> &action=add'"> <%end if%> </td> </tr> </form> </table> 判断完后出现的页面: <%'记录非法操作代码日志 ip=request.servervariables("remote_addr") toppath = server.mappath("sia-log.asp") set fs = createobject("scripting.filesystemobject") if not fs.fileexists(toppath) then set ts = fs.createtextfile(toppath, true) ts.close end if set ts= fs.opentextfile(toppath,1) do while not ts.atendofstream errorlog = errorlog & ts.readline & chr(13) & chr(10) loop ts.close errorlog =errorlog & " <br> 非法操作ip:"&request.servervariables("remote_host") & " 非法操作代码:" & request("allquery") & " 非法操作时间:" & now() set ts= fs.opentextfile(toppath,2) ts.writeline (errorlog) ts.close %> <%response.write "系统自动拦截非法操作代码"&request("allquery")&" 您的真实ip为"&request.servervariables("remote_host")&" <script> alert('"&now()&" 系统自动拦截您的非法操作代码 ,纪录您的非法操作行为');location.href='http://www.siacart.com'; </script> " response.end%> |
|
|
|
|