关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

PHP禁止外站提交、禁止直接访问

发布时间:2021-01-03 22:25:03
1491984010112764.jpg

<?php
// 检查是否直接访问本页面
if( isset($_SERVER['HTTP_REFERER']) ) {
    $url_array = explode('http://', $_SERVER['HTTP_REFERER']);
    $url = explode('/', $url_array[1]);
    if($_SERVER['SERVER_NAME'] != $url[0]) {
        // 您不是从本站来的;
        exit('Access Denied! You are not coming from the site!');
    }
} else {// 禁止直接访问此页;
    exit('Access Denied! Please do not load this page directly.');
}

?>



/template/Home/8a/PC/Static