Search the Community
Showing results for tags 'headers'.
Probably a very silly question to a knowledgeable person, but still: I know nothing should be sent to a browser before header() is sent there. I also know that nothing should be sent to a browser before a cookie is set. What if I need a header AND a cookie on the same page? Would they interfere with each other? Should a cookie be set before a header, or vice versa? Thanks in advance for your help!
My question is mainly regarding Chapter 11, sub-chapter "Understanding HTTP Headers", Pg. 357 - but it also includes more general basic question. There's a line on Pg. 357: "Before getting to the example, note that if a script uses multiple header( ) calls, each should be terminated by a newline (\n) as in the preceding code snippets." Why? (The reason isn't explained in the book.) Also. I see that Larry is using \n quite liberally in his code. I want to understand the reasons. One of them, probably the main one, I guess, is to make the resulting HTML code more readable. What are other possible reasons?