晓杨防红全解
<?php
include ("./includes/common.php");
header("Access-Control-Allow-Origin:*");
header("Access-Control-Allow-Methods:GET,POST");
header('Access-Control-Allow-Headers:x-requested-with,content-type');
header("Content-Type: text/html; charset=utf-8");
//防刷
$sj1 = file_get_contents('includes/sj.php');
$sj2 = date("Y-m-d H:i:s");
if ($sj1 >= $sj2) {
exit('{"msg":"系统正忙!请等待'.$conf['zzly'].'秒后再试吧~"}');
}
//获取接口
$http=get_headers('http://'.$_SERVER['HTTP_HOST']);
//耗时 0.67~0.78
if ($http[0] == 'HTTP/1.1 200 OK') {
$sgx = file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/?go=api');
}else{
if ($http[0] == 'HTTP/1.1 301 Moved Permanently') {
$sgx = file_get_contents('https://'.$_SERVER['HTTP_HOST'].'/?go=api');
}else{
exit('{"msg":"网站SSL配置错误"}');
}
}
?>
评论