Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to read headers?

    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!

  • #2
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    headers_list()?
    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(), but I'm uncertain if there is a similar option for other server applications.
    Last edited by Fou-Lu; 09-23-2005 at 10:01 AM.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #4
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Hmm, you can try apache_response_headers() 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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #6
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Last edited by looka; 09-24-2005 at 01:16 PM.

  • #7
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmmm.. the question was how do i read entire headers, RECEIVED from a browser... any help here?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •