RE: [PHP] Finding what headers and content were already been sent

2002-05-31 Thread Rasmus Lerdorf

Ok, I have added apache_response_headers() which returns the current set
of headers that Apache either knows about at this point (before the
headers are sent) or the set of sent headers once they have actually gone
out.  This will be in 4.3

-Rasmus

On Sat, 1 Jun 2002, Noor Dawod wrote:

> Ok, I understand about the request headers.
>
> While searching the archives, I've seen many requests from many people
> asking similar questions. You even answered some. The thing is that
> while there's a function to get request headers (getallheaders() or the
> $HTTP_ vars), there's no function to list the response headers, although
> you can easily see them in a phpinfo() page.
>
> How hard it'll be to do that function? Why no one adds it to PHP
> already? I mean, phpinfo() already knows of the response headers, why
> not just write a function so that scripts can have access to them. That
> of course is better than writing a private header() replacement, and
> saving headers there for a later access.
>
> Noor
>
>
> -Original Message-
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: ? 01  2002 01:13
> To: Noor Dawod
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Finding what headers and content were already been
> sent
>
>
> You can loop through $GLOBALS and check for vars that start with
> "HTTP_",
> but yes, you typically know which things you are interested in.
>
> And no, $HTTP_* are only the request headers.  For the Apache module
> version there is of course also getallheaders()
>
> -Rasmus
>
> On Sat, 1 Jun 2002, Noor Dawod wrote:
>
> > And how do I KNOW which $HTTP_ variables are being set?
> > Also, does $HTTP_ACCEPT_LANGUAGE mean that "Accept-Language" command
> has
> > been sent by the browser?
> > In my Windows configuration, using CGI version for example, I don't
> see
> > also the headers sent by the server...
> >
> > Noor
> >
> >
> > -----Original Message-
> > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> > Sent: ? 01  2002 00:34
> > To: Noor Dawod
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Finding what headers and content were already been
> > sent
> >
> > > By the way, I know that PHP's phpinfo() function lists headers
> > received
> > > and headers sent, but I couldn't find how can I access them in PHP.
> In
> > > addition, how do I know what content has been sent at any point in a
> > > script?
> >
> > $HTTP_* has them all.
> >
> > -Rasmus
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Finding what headers and content were already been sent

2002-05-31 Thread Noor Dawod

Ok, I understand about the request headers.

While searching the archives, I've seen many requests from many people
asking similar questions. You even answered some. The thing is that
while there's a function to get request headers (getallheaders() or the
$HTTP_ vars), there's no function to list the response headers, although
you can easily see them in a phpinfo() page.

How hard it'll be to do that function? Why no one adds it to PHP
already? I mean, phpinfo() already knows of the response headers, why
not just write a function so that scripts can have access to them. That
of course is better than writing a private header() replacement, and
saving headers there for a later access.

Noor


-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: ? 01  2002 01:13
To: Noor Dawod
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Finding what headers and content were already been
sent


You can loop through $GLOBALS and check for vars that start with
"HTTP_",
but yes, you typically know which things you are interested in.

And no, $HTTP_* are only the request headers.  For the Apache module
version there is of course also getallheaders()

-Rasmus

On Sat, 1 Jun 2002, Noor Dawod wrote:

> And how do I KNOW which $HTTP_ variables are being set?
> Also, does $HTTP_ACCEPT_LANGUAGE mean that "Accept-Language" command
has
> been sent by the browser?
> In my Windows configuration, using CGI version for example, I don't
see
> also the headers sent by the server...
>
> Noor
>
>
> -Original Message-
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: ? 01  2002 00:34
> To: Noor Dawod
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Finding what headers and content were already been
> sent
>
> > By the way, I know that PHP's phpinfo() function lists headers
> received
> > and headers sent, but I couldn't find how can I access them in PHP.
In
> > addition, how do I know what content has been sent at any point in a
> > script?
>
> $HTTP_* has them all.
>
> -Rasmus
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Finding what headers and content were already been sent

2002-05-31 Thread Rasmus Lerdorf

You can loop through $GLOBALS and check for vars that start with "HTTP_",
but yes, you typically know which things you are interested in.

And no, $HTTP_* are only the request headers.  For the Apache module
version there is of course also getallheaders()

-Rasmus

On Sat, 1 Jun 2002, Noor Dawod wrote:

> And how do I KNOW which $HTTP_ variables are being set?
> Also, does $HTTP_ACCEPT_LANGUAGE mean that "Accept-Language" command has
> been sent by the browser?
> In my Windows configuration, using CGI version for example, I don't see
> also the headers sent by the server...
>
> Noor
>
>
> -Original Message-
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: ? 01  2002 00:34
> To: Noor Dawod
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Finding what headers and content were already been
> sent
>
> > By the way, I know that PHP's phpinfo() function lists headers
> received
> > and headers sent, but I couldn't find how can I access them in PHP. In
> > addition, how do I know what content has been sent at any point in a
> > script?
>
> $HTTP_* has them all.
>
> -Rasmus
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Finding what headers and content were already been sent

2002-05-31 Thread Noor Dawod

And how do I KNOW which $HTTP_ variables are being set?
Also, does $HTTP_ACCEPT_LANGUAGE mean that "Accept-Language" command has
been sent by the browser?
In my Windows configuration, using CGI version for example, I don't see
also the headers sent by the server...

Noor


-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: ? 01  2002 00:34
To: Noor Dawod
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Finding what headers and content were already been
sent

> By the way, I know that PHP's phpinfo() function lists headers
received
> and headers sent, but I couldn't find how can I access them in PHP. In
> addition, how do I know what content has been sent at any point in a
> script?

$HTTP_* has them all.

-Rasmus



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Finding what headers and content were already been sent

2002-05-31 Thread Rasmus Lerdorf

> I need to find out, at any point in a PHP script, which headers and what
> content (HTML or other) have been sent already. I know I can use output
> buffering, but in my case, this is not going to work.

You really have no way of knowing since it is the web server that decides
which http headers to ultimately send.

> By the way, I know that PHP's phpinfo() function lists headers received
> and headers sent, but I couldn't find how can I access them in PHP. In
> addition, how do I know what content has been sent at any point in a
> script?

$HTTP_* has them all.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php