保护你的ASP页面的两种办法
发布时间:2008-06-10 16:53:00
标签:盗链,IP,asp
保护你的ASP页面的两种办法 有时候你只想让人们从你的站点来访问你的某些页面, 而不允许他们从其它站点的非法链接中到达这些页面。
在你想保护的ASP页面的顶部加上这些代码:
< %
if left(Request.ServerVariables("HTTP_REFERER"),24)
<> "http://www.yoursite.com/" and _
Request.ServerVariables("HTTP_REFERER") <> "" then
'We used Request.ServerVariables to get the domain name
'of the referring Web page.
'If the domain name doesn't equal my domain name, then
'I want to send the user to some other site
Response.Redirect "http://www.yahoo.com"
end if
% >
上面这个方法一般用于下载系统的防盗链功能上。如果来源页面不是本站就直接跳转到首页。
第二种办法是利用IP地址来判断用户访问的合法性,当你没有域名时, 用这种办法来进行在线测试是再方便不过的. 在你的ASP页面顶部加上这些代码:
< %
if Request.ServerVariables("REMOTE_HOST") <> "195.161.73.13" and _
Request.ServerVariables("REMOTE_HOST") <> "" then
'Send them away, if you like
Response.Redirect "http://www.yahoo.com"
end if
% >
0
投稿
猜你喜欢
- 简介Puppeteer是Google开发并开源的一款工具,可用代码驱动浏览器操作。由于诸多优秀的特性,Puppeteer常被用在爬虫与自动化
- Config:服务端连接Git配置,代码如下所示:1、导入依赖<dependencies> <d
- Q1 :如何解压 rar 压缩包文件?A :Step1:检查是否有 rarfile 第三方库,若没有该模块,则需要进行安装 ;Step2:参
- 目标站点分析本次要抓取的目标站点为:中介网,这个网站提供了网站排行榜、互联网网站排行榜、中文网站排行榜等数据。网站展示的样本数据量是 :58
- 现有1.php内容如下: <?phpecho 'hi\nhi';在命令行中执行该文件: bash >> p
- CSS的学习和其他的学习一样,都需要特定的方法才能比较快的去掌握它.要想掌握CSS, 首先要学会HTML,我刚开始是从零开始学习的
- 本文实例讲述了Python使用crontab模块设置和清除定时任务操作。分享给大家供大家参考,具体如下:centos7下安装Python的p
- 计算机之所以能做很多自动化的任务,因为它可以自己做条件判断。比如,输入用户年龄,根据年龄打印不同的内容,在Python程序中,可以用if语句
- 在上篇文章给大家介绍了:MySQL8.0.20安装教程及其安装问题详细教程 https://www.jb51.net/artic
- 当我们用一个构造函数创建对象时,其属性就会被添加到this中去。并且被添加到this中的属性实际上不会随着实体发生改变,这时,我们这种做法显
- 本文实例讲述了PHP实现的简单排列组合算法应用。分享给大家供大家参考,具体如下:一、问题:给你一个40斤的西瓜,给3个人分,有多少种分法?二
- CSS是众所周知且应用广泛的网站样式语言,在它的版本三(CSS3)计划中,新增了一些能够节省时间的特性。尽管只有当前最新了浏览器
- LRU缓存算法,指的是近期最少使用算法,大体逻辑就是淘汰最长时间没有用的那个缓存,这里我们使用有序字典,来实现自己的LRU缓存算法,并将其包
- 一、安装插件npm install -D vuedraggable二、在需要排序的界面中引入组件<script>import d
- /** * 类说明:对MYSQL数据库的操作类 */ using System; using System.Data; using MySq
- 面部识别----考勤打卡、注册登录、面部支付等等...感觉很高大上,又很方便,下面用python中的框架--django完成一个注册登录的功
- 目录前期准备界面编写截图功能实现OCR实现内容显示总结前期准备在这个阶段主要准备整个小程序的结构,既然要实现ocr,那么输入就是一张图片,而
- 1、安装pecl及创建快捷键(若安装php时已带可忽略这步安装步骤)# cd /usr/local/php/bin/ //可查看
- 循环可以用来重复执行某条语句,直到某个条件得到满足或遍历所有元素。1 for循环是for循环,可以把集合数据类型list、tuple、dic
- 1. 编码问题:遇到了几个字符串转换问题,总结如下:# str to bytes str.encode(s)# bytes to str b