Re: Ip-to-country
| From: | Rasmus Lerdorf | Date: | Mon, 05 May 2003 22:49:02 +0000 |
| Subject: | Re: Ip-to-country | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-17343@lists.php.net to get a copy of this message | ||
On Mon, 5 May 2003, Jim Winstead wrote:
> perhaps it is getting confused by multiple ip addresses in the
> X-Forwarded-For header?
>
> it gets it right from three machines i tried. (one in the us, one in
> sweden, one in germany.)
My request from the office looks like this:
GET /my.php HTTP/1.0
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Encoding: gzip,deflate,compress;q=0.9
Accept-Language: en-us,en;q=0.5
Cache-Control: max-age=259200
Connection: keep-alive
Cookie: LAST_LANG=en; MAGIC_COOKIE=xxxxxxxxxxxxxxxxxxxxxxxxxxx; COUNTRY=NA
Host: www.php.net
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314
Via: 1.1 rs1.php.net:80 (Squid/2.4.STABLE7)
X-Forwarded-For: 207.126.232.175
Which shows me that at some point in the past it couldn't figure it out.
Perhaps from my home connection and that got cached. If I clear my
COUNTRY cookie it works from the office. It might be an idea to stick the
ip that was attempted into the COUNTRY cookie.
-Rasmus