...

View Full Version : how to read headers?



looka
09-22-2005, 10:49 PM
how can i get ALL headers sent from a remote host to a srerver when calling some file?
any difference in headers for:
-link
-image

?

thanks!

looka
09-22-2005, 11:00 PM
oh, and what if i set a non-existant header with function
header('myheader:heloo_everybody');

does server send it? does user agent receives it? does it produces error?

and what the opposite way - if i somehow set up non-exisztant header with my browser? how can i read it in server?

Fou-Lu
09-23-2005, 10:57 AM
headers_list() (http://ca3.php.net/manual/en/function.headers-list.php)?
I'm not sure about your last question, what would be the point of sending a 'fake' header to the client?
Oh, apache can pick up headers using apache_request_headers() (http://ca3.php.net/manual/en/function.apache-request-headers.php), but I'm uncertain if there is a similar option for other server applications.

looka
09-23-2005, 03:22 PM
that headers_list() is from php5 on... but its okay with apache, almost everybody is using it.

whay sending fake header... complicated story, basically, that would be the way to avoid follow the Location: header in certain moments...

Fou-Lu
09-23-2005, 03:27 PM
Hmm, you can try apache_response_headers() (http://ca3.php.net/manual/en/function.apache-response-headers.php) which is available on php 4.3.0+
I still don't understand why you would need fake headers. I mean, I make use of only three types:
location
http/1.0
and
content-type
within my php. If its a variable method of some sorts, you'd be looking at sessions. But fake headers I would tend to think would end up being unreliable as the brower will discard what it doesn't use, and won't give you what it cannot understand.

looka
09-24-2005, 02:04 PM
i think i wont - at least not if i call a file via xmlhttp method :)


yes, i tested it - headers('stupid: yes'); has been shown normally when called the getAllResponseHeaders() and getResponseHeader('stupid') yiha:):):):):)

looka
09-26-2005, 10:36 AM
hmmm.. the question was how do i read entire headers, RECEIVED from a browser... any help here?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum