Reply to Re: newbie: need help with "headers already sent" error

Your name:

Reply:


Posted by Carl Pearson on 01/12/07 15:40

Koncept wrote:
> In article <12qdd8p56ccv3b8@corp.supernews.com>, Hendri Kurniawan
> <ask-me@email.com> wrote:
>
>> Simply add exit() after your header statement to:
>>
>> <?php
>> session_start();
>> if ($_GET["mode"] == "logout") {
>> header("Location: index.php");
>> exit();
>> }
>> ?>
>>
>> Hendri Kurniawan
>
> I agree with Hendri. This is "exit" what is missing from your code.
> Make sure to always place exit() after redirection or use buffers.
>

Right. A small function I use for redirection...

function Redirect($Url = "/")
{
echo "<script
language='JavaScript'>document.location.href='".$Url."'</script>";
exit;
}

[Back to original 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

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