You are here: Re: HEADERS Already sent (NewBie question) « PHP Programming Language « IT news, forums, messages
Re: HEADERS Already sent (NewBie question)

Posted by Angelos on 05/14/05 12:53

>> Hello again... I was wondering is there any way to check or output in the
>> errors string which file or where in my code the headers have been sent ?
>
> This is the error message I get with PHP 4.1.2 when such error happens:
>
> Warning: Cannot add header information - headers already sent by (output
> started at /mnt/webs/Pruebas/www/borrame.php:7) in
> /mnt/webs/Pruebas/www/borrame.php on line 9
>
> Have you disabled error reporting? Try this:
>
> error_reporting(E_ALL);

I have enabled the error reporting. And I also have
error_reporting = E_ALL
which should report my errors as you say above. Although it doesn't work for
some reason.

The only error that I get is the one that I wrote in my function:
function redirect($url)
{
if(!headers_sent())
{
header('Location: http://'.$_SERVER['HTTP_HOST'] .
dirname($_SERVER['PHP_SELF']) . '/' . $url);
}
else
{
die('Could not redirect; Headers already sent.');
}
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация