How to get http header infomation using PHP?

This is a discussion on How to get http header infomation using PHP? within the PHP Language forums, part of the PHP Programming Forums category; Hi all, Is there any way to get all the information in HTTP header? I want to get a item ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-21-2004
Lian
 
Posts: n/a
Default How to get http header infomation using PHP?

Hi all,
Is there any way to get all the information in HTTP header? I want to
get a item called "Referring URL" in HTTP header. I find the information
is not contained in the environment global variable $_SERVER.

Thank you for suggestions!
Reply With Quote
  #2 (permalink)  
Old 10-21-2004
Daniel Tryba
 
Posts: n/a
Default Re: How to get http header infomation using PHP?

Lian <lian@dsdfsdf.com> wrote:
> Is there any way to get all the information in HTTP header? I want to
> get a item called "Referring URL" in HTTP header. I find the information
> is not contained in the environment global variable $_SERVER.


print_r($_SERVER) prints all available headers and more. The referrer is
probably stored in 'HTTP-REFERER' IIRC.

BTW know that referrer is totally unreliable. Some clients or proxys
filter them, or anyone can easily forge them.

--

Daniel Tryba

Reply With Quote
  #3 (permalink)  
Old 10-21-2004
Pedro Graca
 
Posts: n/a
Default Re: How to get http header infomation using PHP?

Lian wrote:
> Is there any way to get all the information in HTTP header? I want to
> get a item called "Referring URL" in HTTP header. I find the information
> is not contained in the environment global variable $_SERVER.


Maybe the browser you're testing with is like mine and doesn't send that
information to the server.

For browsers that do send the 'REFERER' it appears in the $_SERVER
array.
If you can trust it or not is another completely different story.

> Thank you for suggestions!


Try to do whatever you're trying to do with $_SESSION variables.
--
USENET would be a better place if everybody read:
http://www.expita.com/nomime.html
http://www.netmeister.org/news/learn2quote2.html
http://www.catb.org/~esr/faqs/smart-questions.html
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:11 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0