Denlig
Новичок
Правильный redirect
Написал функцию:
Выдает ошибку:
Написал функцию:
PHP:
function redirect($url)
{
/*
print("<html><head>\n");
print("<meta http-equiv='refresh', content='0'; URL=$url >\n");
print("</head></html>\n");
*/
/* Redirect to a different page in the current directory that was requested */
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'index.php';
header("Location: http://$host$url");
//header("Location: http://$host$uri/$extra");
exit;
}
Я понимаю, что просто уже что то отправилось, поэтому и нельзя перейти. Просто может подскажите как сделать мега универсальный редирек? (так сказать на все случае жизни и при любых условиях =) )Warning: Cannot modify header information - headers already sent by (output started at C:\WebServer\homepage\realestate\admin\head.php:7) in C:\WebServer\homepage\realestate\function\function.php on line 70