当前位置:Gxlcms > PHP教程 > php通过判断来源主机头进行防盗链,php来源_PHP教程

php通过判断来源主机头进行防盗链,php来源_PHP教程

时间:2021-07-01 10:21:17 帮助过:6人阅读

php通过判断来源主机头进行防盗链,php来源


check.php

<html>
<body>
<form action="test.php" method="post">
    message<input type="text" name="name" value="123456" />
    <input type="submit" value="submit" />
form>
body>
html>

test.php

php
header("Content-type:text/html;charset='utf8'");
error_reporting(E_ALL);

$url = parse_url($_SERVER['HTTP_REFERER']);
//print_r($url);
if($url['host'] != "localhost"){
    echo "";
    exit(0);
}else{
    echo "";
    echo "

Hello World!

"; }

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1051325.htmlTechArticlephp通过判断来源主机头进行防盗链,php来源 check.php html body form action ="test.php" method ="post" message input type ="text" name ="name" value ="123456" / input...

人气教程排行