跪求求防止恶意提交的方法,本人现维护一小网站遭人恶意攻击,寻求解决指点,在线等。
小人现有网站http://www.szwbxjz.com,其中设有一个“明星小记者”的栏目,主要的想法是通过网友不记名投票选出前十位选手,但近几天总有不正常的投票数据波动,怀疑是有人恶意提交了或者是网站受到了攻击,希望专家们给予指点,不胜感激!
下面是提交投票页面的源码:
<!--#include file="conn.asp" -->
<!--#include file="../function.asp" -->
<!--#include file="../admin/function/select_field.asp" -->
<%
ID=trim(request.QueryString("ID"))
if trim(request.Cookies("iP")(ID))=ID then
Response.Write "<Script Language=JavaScript>alert('你已经投了他一票了,请不要重复投票!');history.back(-1)</Script>"
Response.end
end if
if isnumeric(ID) then
set rs=server.CreateObject("adodb.recordset")
sql="select top 1 * from [Vote] where ID="&id
rs.open sql,conn,3,3
if not rs.eof then
vote_num=rs("vote_num")
rs("vote_num")=vote_num+1
rs.update
end if
rs.close
set rs=nothing
'conn.execute("update [Vote] set vote_num=vote_num+1 where ID="&ID)
response.Cookies("IP")(ID)=ID
response.cookies("IP").expires=date()+1
end if
%>
<script language="javascript">
alert("投票成功,谢谢您的参与");
window.location.href='xjzx.asp';
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
</body>
</html>