最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
PHP实现禁止网外链接网址的方式查看网页
时间:2022-07-02 10:10:24 编辑:袖梨 来源:一聚教程网
// 禁止网外链接(例如搜索引擎)查看网页内容
if(!empty($_SERVER['HTTP_REFERER']))
{
preg_match("/^(http://)**?([^/]*+)/i",$_SERVER['HTTP_REFERER'], $matches);
$host = $matches[2];
if(($host=="211.152.50.35")||($host==www.phpv.net))
{
}
else
{
header("Location:http://www.p**h*pv.net");
exit;
}
}
// 禁止直接输入网址查看网页内容
else
{
header("Location:http://www.p**h*pv.net");
exit;
}
只有点击超链接(即
if(!empty($_SERVER['HTTP_REFERER']))
{
preg_match("/^(http://)**?([^/]*+)/i",$_SERVER['HTTP_REFERER'], $matches);
$host = $matches[2];
if(($host=="211.152.50.35")||($host==www.phpv.net))
{
}
else
{
header("Location:http://www.p**h*pv.net");
exit;
}
}
// 禁止直接输入网址查看网页内容
else
{
header("Location:http://www.p**h*pv.net");
exit;
}
只有点击超链接(即