You are here: Re: URGENT: Prevent default HTTP headers from being sent « PHP Programming Language « IT news, forums, messages
Re: URGENT: Prevent default HTTP headers from being sent

Posted by Lisa Pearlson on 06/29/05 03:34

the client is dumb, it has no use for the http headers, it always expects a
fixed length binary data.
It can send headers just to please apache and make sure it gets to the right
script on the right domain.

I use http instead of writing my own daemon, so I can take advantage of
apache's features, such as handling a lot of simultaneous connections and
other tools meant for http, such as logging software etc. if I can use a
standard solution, it's always better than writing my own.. especially if it
suits all my needs except one minor one, useless headers.

Getting rid of these headers is only important because communication is very
expensive, per kilobyte of data.. so every byte I can save, leads to quite a
big saving.


"Colin McKinnon" <colin.deletethis@andthis.mms3.com> wrote in message
news:d9r0a8$69d$1$8300dec7@news.demon.co.uk...
> Lisa Pearlson wrote:
>
>> Hi,
>>
>> I have a php script with no more than this:
>>
>> <?php echo "Hello World!"; ?>
>>
> <snip>
>>
>> c
>> Hello World!
>> 0
>>
>> =======================
>> QUESTIONS:
>> - Where do the 'c' and '0' come from? '0' just denoting the end of the
>> data? -
>
> They shouldn't be there - most likely a charset issue - from the shell try
> cat -v myscript.php
>
>> How do I prevent HTTP headers sent back to the client? I wish to
>> only send "Hello World!", without any headers.
>
> Then you can't do it via HTTP / an apache module (actually, you probably
> could, but it would ned a lot of hacking). Without HTTP though, there's no
> defined way of getting parameters into your script.
>
>> The reason is that the
>> client will be a piece of hardware that expects binary data as response,
> <snip>
>>
>> I use the following php script to simulate a client requesting the php
>> page, and display the headers:
>>
>> $header = "POST $cgi HTTP/1.1\r\n";
>> $header .= "Host: $host\r\n";
> <snip>
>
> There's something very broken here - the client wants to talk HTTP, but
> you
> say that it won't listen to HTTP. R U sure?
>
> C.

 

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

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