如何去掉投票系统的IP限制,asp程序 50
我有一段代码,限制了同一IP不能重复投票,请高手改一下,高分相赠<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!--#includefil...
我有一段代码,限制了同一IP不能重复投票,请高手改一下,高分相赠
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
if request.Cookies("pointed") = "" then
if request("menberid") = "" then
response.Write("<script>alert('要投票必须选择至少一个主题!');history.go(-1)</script>")
response.End()
else
set rs = server.CreateObject("adodb.recordset")
sqlstr = "insert into pointer (UserName,sex,age,address,tel,email,selmenbers)values('"
sqlstr2 = "update menber set point = point + 1 where id in("
sqlstr = sqlstr&request("UserName")&"','"&request("sex")&"','"&request("age")&"','"&request("address")&"','"&request("tel")&"','"&request("email")&"','"&request("menberid")&"')"
sqlstr2 = sqlstr2 & request("menberid") & ")"
rs.open sqlstr,conn,3,1
rs.open sqlstr2,conn,3,1
Response.Cookies("pointed").Expires = Date + 1
Response.Cookies("pointed") = "1"
response.Write("<script>alert('提交成功,谢谢您参与投票!');location.href='index.asp'</script>")
end if
else
response.Write("<script>alert('对不起,您先前已经投了一票,谢谢您的参与!');location.href='index.asp'</script>")
end if
%>
如何只保留投票,去掉其他必须要的填写信息,直接投票! 展开
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
if request.Cookies("pointed") = "" then
if request("menberid") = "" then
response.Write("<script>alert('要投票必须选择至少一个主题!');history.go(-1)</script>")
response.End()
else
set rs = server.CreateObject("adodb.recordset")
sqlstr = "insert into pointer (UserName,sex,age,address,tel,email,selmenbers)values('"
sqlstr2 = "update menber set point = point + 1 where id in("
sqlstr = sqlstr&request("UserName")&"','"&request("sex")&"','"&request("age")&"','"&request("address")&"','"&request("tel")&"','"&request("email")&"','"&request("menberid")&"')"
sqlstr2 = sqlstr2 & request("menberid") & ")"
rs.open sqlstr,conn,3,1
rs.open sqlstr2,conn,3,1
Response.Cookies("pointed").Expires = Date + 1
Response.Cookies("pointed") = "1"
response.Write("<script>alert('提交成功,谢谢您参与投票!');location.href='index.asp'</script>")
end if
else
response.Write("<script>alert('对不起,您先前已经投了一票,谢谢您的参与!');location.href='index.asp'</script>")
end if
%>
如何只保留投票,去掉其他必须要的填写信息,直接投票! 展开
3个回答
展开全部
只改两句:
Response.Cookies("pointed").Expires = Date - 1 '改成减一
Response.Cookies("pointed") = "" '把1去掉, 就OK了.
下面是完整的:
<%
if request.Cookies("pointed") = "" then
if request("menberid") = "" then
response.Write("<script>alert('要投票必须选择至少一个主题!');history.go(-1)</script>")
response.End()
else
set rs = server.CreateObject("adodb.recordset")
sqlstr = "insert into pointer (UserName,sex,age,address,tel,email,selmenbers)values('"
sqlstr2 = "update menber set point = point + 1 where id in("
sqlstr = sqlstr&request("UserName")&"','"&request("sex")&"','"&request("age")&"','"&request("address")&"','"&request("tel")&"','"&request("email")&"','"&request("menberid")&"')"
sqlstr2 = sqlstr2 & request("menberid") & ")"
rs.open sqlstr,conn,3,1
rs.open sqlstr2,conn,3,1
Response.Cookies("pointed").Expires = Date - 1
Response.Cookies("pointed") = ""
response.Write("<script>alert('提交成功,谢谢您参与投票!');location.href='index.asp'</script>")
end if
else
response.Write("<script>alert('对不起,您先前已经投了一票,谢谢您的参与!');location.href='index.asp'</script>")
end if
%>
Response.Cookies("pointed").Expires = Date - 1 '改成减一
Response.Cookies("pointed") = "" '把1去掉, 就OK了.
下面是完整的:
<%
if request.Cookies("pointed") = "" then
if request("menberid") = "" then
response.Write("<script>alert('要投票必须选择至少一个主题!');history.go(-1)</script>")
response.End()
else
set rs = server.CreateObject("adodb.recordset")
sqlstr = "insert into pointer (UserName,sex,age,address,tel,email,selmenbers)values('"
sqlstr2 = "update menber set point = point + 1 where id in("
sqlstr = sqlstr&request("UserName")&"','"&request("sex")&"','"&request("age")&"','"&request("address")&"','"&request("tel")&"','"&request("email")&"','"&request("menberid")&"')"
sqlstr2 = sqlstr2 & request("menberid") & ")"
rs.open sqlstr,conn,3,1
rs.open sqlstr2,conn,3,1
Response.Cookies("pointed").Expires = Date - 1
Response.Cookies("pointed") = ""
response.Write("<script>alert('提交成功,谢谢您参与投票!');location.href='index.asp'</script>")
end if
else
response.Write("<script>alert('对不起,您先前已经投了一票,谢谢您的参与!');location.href='index.asp'</script>")
end if
%>
展开全部
if request.Cookies("pointed") = "" then
else
response.Write("<script>alert('对不起,您先前已经投了一票,谢谢您的参与!');location.href='index.asp'</script>")
end if
k掉以上语句
else
response.Write("<script>alert('对不起,您先前已经投了一票,谢谢您的参与!');location.href='index.asp'</script>")
end if
k掉以上语句
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
bz
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询