I have a problem with my under construction code with PHP.
This is my code:
PHP: (init.php)
$date = new DateTime();
if ($date->format('Y-m-d H:i:s') < $row['ending']) {
construct();
}
The construct(); function: (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");
}
}
And the error i have is that it dosen't redirect it. Please help, Thanks!