您的位置:首页 > 编程语言

禁止站外提交参数测试代码

2006-09-12 18:06 190 查看
<%
if request("action")="add" then
if CheckWebSitePage=true then
response.Write("检测通过")
else
response.Write("检测不通过")
Response.end
end if
end if

Function CheckWebSitePage()
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
response.Write("<br>上一页面地址"&server_v1)
response.Write("<br>服务器地址"&server_v2)
response.Write("<br>"&mid(server_v1,8,len(server_v2)))

if mid(server_v1,8,len(server_v2))<>server_v2 then
CheckWebSitePage=false
else
CheckWebSitePage=true
end if

End Function

%>
<p align="center">
<form id="form1" name="form1" method="post" action="?action=add">
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</form>
</p>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: