PHP header Location works in the middle of HTML -


I have a problem understanding how a header ("Location: http://www.google. Com / "); & lt; Body & gt; can work in the middle.
Should not be an error because the header has already been sent due to HTML output, & lt ;? Php ...? & Gt; The way before starting the part.

I am referring to the warning header information can not be modified - already sent headers ... I hope to receive.

I'm testing it on my local PHP Dev environment (Apache / 2.2.15 (Win32) PHP / 5.3.2).

Here's an example:

  & lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;? Php header ("location: http://www.google.com/"); ? & Gt; & Lt; / Body & gt; & Lt; / Html & gt;  

Any ideas? Thank you.

If you have automatic buffering enabled in php.ini, you can use any time before it The headers can actually open the output.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -