<?php
$url1 = "http://你的域名/";//主网站
$url2 = "https://www.xladmin.com/"; //备用网站
$array = get_headers($url,1);
if(preg_match('/200/',$array[0])){ //200为正常代码,经常见到的还有404,400,500等
echo "<script language='javascript' type='text/javascript'>";
echo "window.location.href='$url1'";
echo "</script>";
// echo "<pre/>";
// print_r($array);
}else{
echo "<script language='javascript' type='text/javascript'>";
echo "window.location.href='$url2'";
echo "</script>";
}
?>
Comments | NOTHING
该文章已经关闭评论