我的 PHP 正在建设中的代码有问题。这是我的代码:
PHP: (init.php)
$date = new DateTime();
if ($date->format('Y-m-d H:i:s') < $row['ending']) {
construct();
}
构造();功能:(general.php)
$current_file = explode('/', $_SERVER['SCRIPT_NAME']);
$current_file = end($current_file);
function construct() {
$allow = array("MY IP");
if (!in_array ($_SERVER['REMOTE_ADDR'], $allow)) {
header ("Location: construct");
}
}
我的错误是它没有重定向它。请帮忙,谢谢!