You are here: Re: Observations regarding redirection « All PHP « IT news, forums, messages
Re: Observations regarding redirection

Posted by Tyno Gendo on 09/14/07 13:58

yes, i fell into that trap once...

you always need to exit( header('Location: /blah.php') ); to avoid code
after the header being executed.

Kevin Thorpe wrote:
> Albert Ahtenberg wrote:
>> Hello,
>>
>> I don't know if it is only me but I was sure that header("Location:url")
>> redirects the browser instantly to URL, or at least stops the
>> execution of
>> the code. But appearantely it continues to execute the code until the
>> browser send his reply to the header instruction. So an exit(); after
>> each
>> redirection won't hurt at all
>
> header('Location:xxx') simply adds the redirection as a header line at
> the top of the document. The rest of the script still continues to
> execute. Once the browser has loaded the document it reads the header
> and goes off to load the redirected page. You will need an exit() after
> such a redirection.
>

 

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

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