当前位置 : 主页 > 网络编程 > PHP >

origin.php

来源:互联网 收集:自由互联 发布时间:2021-06-28
origin.php $http_origin = isset($_SERVER['HTTP_ORIGIN'])?$_SERVER['HTTP_ORIGIN']:'';$acceptOrigin=[ 'http://zx.b.cc','http://lbs.b.cc','http://sc.b.cc'];if (in_array($http_origin, $acceptOrigin)) { header('Access-Control-Allow-Origin:'.$htt
origin.php
$http_origin = isset($_SERVER['HTTP_ORIGIN'])?$_SERVER['HTTP_ORIGIN']:'';
$acceptOrigin=[
    'http://zx.b.cc','http://lbs.b.cc','http://sc.b.cc'
];
if (in_array($http_origin, $acceptOrigin)) {
    header('Access-Control-Allow-Origin:'.$http_origin);
    header('Access-Control-Allow-Headers:X-Requested-With, accept, content-type, xxxx');
    header('Access-Control-Allow-Credentials:true');
}
网友评论