php 禁止 URL 直接访问 php文件
            时间:2014-08-06 11:49:21  
            收藏:0  
            阅读:308
        
        
        通过判断访问来源来实现。
$fromurl="http://www.111.com/index.php"; //只能从这个地址访问 if( $_SERVER[‘HTTP_REFERER‘] != $fromurl ) { header("Location:".$fromurl); exit; } 不好意思。理解错误。。。改一下代码。。 $fromurl="http://www.111.com/index.php"; //跳转往这个地址。 if( $_SERVER[‘HTTP_REFERER‘] == "" ) { header("Location:".$fromurl); exit; }
            评论(0)