noirfan Posted April 9, 2011 Share Posted April 9, 2011 On page 323 of the book, it says "if a script uses multiple header() calls, each should be terminated by a newline." However, I've seen elsewhere in the book and in the PHP Advanced, code using multiple headers without being terminated by a newline. I've also tried searching on the Internet for this rule, but couldn't find anything. Is this a mistake? Probably referring to email headers? Link to comment Share on other sites More sharing options...
Jonathon Posted April 9, 2011 Share Posted April 9, 2011 If your unsure about whether there is an error check the books errata Have you looked into the php manual regarding headers? It may not give you your definitive answer in black and white, but you might be able to come to the answer by reading between the lines. Also try mail() you may find the answer your looking for under additional headers Link to comment Share on other sites More sharing options...
noirfan Posted April 10, 2011 Author Share Posted April 10, 2011 The books errata mentions nothing about it. The PHP site mentions nothing about it, and I see the user notes' code on there using both newlines and without newlines. I know mail requires newlines for multiple headers, but that has nothing to do with this type of header call. I was just merely pointing out a possible confusion Mr. Ullman may have made. I still don't have an answer. Mr. Ullman are you there? Thanks. Link to comment Share on other sites More sharing options...
Jonathon Posted April 10, 2011 Share Posted April 10, 2011 "The header fields are transmitted after the request or response line, the first line of a message. Header fields are colon-separated name-value pairs in clear-text string format, terminated by a carriage return (CR) and line feed (LF) character sequence. The end of the header fields is indicated by an empty field, resulting in the transmission of two consecutive CR-LF pairs" Wikipedia Link to comment Share on other sites More sharing options...
Recommended Posts