Re: Interesting Referer behaviour- how to copy it?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dotan Cohen wrote:
I creating a out.php file that will record clicks, and the redirect
the user to the site that he wanted. I am currently using
header("Location: $url"); which works as expected. The only problem
is, that the browser does not send $HTTP_REFERER info to the recieving
site.

However, that particular site is also linking to me via a out.php
file, and the browser DOES set $HTTP_REFERER on my site. So I've been
googleing for two days, and came up with this: There is a site that
displays the server reesponse of any server. So I put both of our
out.php files to the test. First, his server response:
HTTP/1.1 302 Found
Connection: close
Date: Thu, 04 Aug 2005 15:19:01 GMT
Location: http://lyricslist.com
Server: Apache/2.0.50 (FreeBSD) PHP/5.0.0
Vary: Accept-Encoding
Content-Length: 0
Content-Type: text/html; charset=ISO-8859-1
Client-Date: Thu, 04 Aug 2005 15:32:32 GMT
Client-Response-Num: 1
X-Powered-By: PHP/5.0.0

he runs php5, you run php4 - is the following set on his server perchance?:

echo $_SERVER['HTTP_REFERER'];
//or
echo getenv("HTTP_REFERER");

note that $HTTP_REFERER is depreciated in php5.
also the freeBSD box may have a firewall that is stripping the referer header
- freeBSD is the paranoid man's *nix of choice after all - at least all the
security freaks I know prefer it.

actually I did a bit of googling and there is a slim possiblity that the
firewall software on your PC is munging the referer header - try turning it off

also proxy servers may be stripping the header.


This redirects to lyricslist.com and correctly sets the $HTTP_REFERER
variable. Now, my server response:
HTTP/1.1 302 Found
Connection: close
Date: Thu, 04 Aug 2005 15:39:25 GMT
Location: http://lyricslist.com
Server: Apache/1.3.33 (Unix) mod_auth_passthrough/1.8
mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.11 FrontPage/5.0.2.2635
mod_ssl/2.8.22 OpenSSL/0.9.7a
Vary: Accept-Encoding
Content-Length: 0
Content-Type: text/html; charset=ISO-8859-1
Client-Date: Thu, 04 Aug 2005 15:39:29 GMT
Client-Response-Num: 1
X-Powered-By: PHP/4.3.11

This just does not set the $HTTP_REFERER variable! The referer
variable is even set to the original page that linked to out.php, and
not out.php itself! I have tried in IE 6.x, Firefox 1.0.6, Pheonix 0.7
(remember that!), and Opera 8.0. What could be the difference?

Thanks to all who rack thier brains on this one! It's been a fruitless
two days for me...

Dotan Cohen
http://lyricslist.com/lyrics/artist_albums/118/chumbawamba.php
Chumbawamba Song Lyrics


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux