View previous topic :: View next topic |
Author |
Message |
titi74 -
Joined: 27 Sep 2005 Posts: 2
|
Posted: Tue Sep 27, 2005 3:23 am Post subject: non parsed header with php |
|
|
What do I need to do to get a page displayed with a non parsed header using php, I want the content to be sent directly to the output without being buffered by the server.
I looked at the documentation, it says that the first line of the output of the script has to begin with HTTP/
How do I do that? I tried header("HTTP/1.1 200"), echo "HTTP/1.1", it doesn't work. |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Tue Sep 27, 2005 7:47 am Post subject: |
|
|
I think it is:
Quote: | header("Content-type: text/html"); |
_________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Tue Sep 27, 2005 8:28 am Post subject: Re: non parsed header with php |
|
|
titi74 wrote: | What do I need to do to get a page displayed with a non parsed header using php, I want the content to be sent directly to the output without being buffered by the server.
I looked at the documentation, it says that the first line of the output of the script has to begin with HTTP/
How do I do that? I tried header("HTTP/1.1 200"), echo "HTTP/1.1", it doesn't work. |
Non parsed header? Elaborate.
You mean without the X-Powered-By header? _________________
 |
|
Back to top |
 |
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Tue Sep 27, 2005 1:16 pm Post subject: Re: non parsed header with php |
|
|
titi74 wrote: | What do I need to do to get a page displayed with a non parsed header using php, I want the content to be sent directly to the output without being buffered by the server.
I looked at the documentation, it says that the first line of the output of the script has to begin with HTTP/
How do I do that? I tried header("HTTP/1.1 200"), echo "HTTP/1.1", it doesn't work. |
"Non parsed header" scripts output is not processed by the web server so you will lose several benefits (such as keep alive, date generation, chunked encoding) that are done automatically by the server when running scripts in the normal mode.
But buffering is not somthing that you can disable with a NPH script. It depends on the web server. Abyss Web Server for example does not buffer scripts (whether NPH or not). But PHP have an internal buffer (see the flush() command for more information).
By the way, to have a NPH script in PHP, your first output should be generated by header and be conforming to the HTTP specification.
The following is wrong(according to HTTP):
Code: | header("HTTP/1.1 200"); |
This is fixed version:
Code: | header("HTTP/1.1 200 OK"); |
After the HTTP code, you must also add the HTTP reason. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
titi74 -
Joined: 27 Sep 2005 Posts: 2
|
Posted: Tue Sep 27, 2005 3:11 pm Post subject: Thanks |
|
|
Tanks you,
You're right, it had nothing to do with non parsed header,
but I had to use both flush() and ob_flush() to make it work, each alone was not enough, I saw that in the php doc.
It was much easier than I thought. |
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Tue Sep 27, 2005 4:48 pm Post subject: |
|
|
Still clueless.
/me shrugs _________________
 |
|
Back to top |
 |
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Wed Sep 28, 2005 12:12 pm Post subject: |
|
|
MonkeyNation wrote: | Still clueless.
/me shrugs |
Quoted from http://www.htmlhelp.com/faq/cgifaq.2.html :
Quote: | 2.6: What is NPH?
NPH = No Parsed Headers. The script undertakes to print the entire
HTTP response including all necessary header fields. The HTTPD
is thereby instructed not to parse the headers (as it would normally do)
nor add any which are missing. |
_________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Wed Sep 28, 2005 12:44 pm Post subject: |
|
|
aprelium wrote: | MonkeyNation wrote: | Still clueless.
/me shrugs |
Quoted from http://www.htmlhelp.com/faq/cgifaq.2.html :
Quote: | 2.6: What is NPH?
NPH = No Parsed Headers. The script undertakes to print the entire
HTTP response including all necessary header fields. The HTTPD
is thereby instructed not to parse the headers (as it would normally do)
nor add any which are missing. |
|
Oh snap, thought NPH was something completley different. Y helo thar double meanings. _________________
 |
|
Back to top |
 |
 |
|