anti-theft_chain.php

<?php
header("content-type:text/html;charset=utf-8");
if(isset($_SERVER['HTTP_REFERER']))
{
	//域名对比,一致下载,不一致跳转到错误页面
	//strpos: 查找字符串首次出现的位置
	if(strpos($_SERVER['HTTP_REFERER'],"http://guofeng.io")===0)
	{
		echo "您可以下载软件了";
	}else
	{
		echo "请从本网站下载";
	}
}
?>

anti-theft_chain.html

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>测试页面</title>
</head>
<body>
	<a href="http://guofeng.io/anti-theft_chain.php">测试页面</p>
</body>
</html>

发表评论

Close Menu