Do you have a question? Post it now! No Registration Necessary. Now with pictures!
April 27, 2005, 4:21 am
rate this thread
Re: browser details
The IP address of the browser OR the nearest proxy is in
$_SERVER['REMOTE_ADDR'] (at least on Apache servers, with PHP as a
module or CGI). If a proxy is in use, you really have no way to
determine the user's real IP (and if the real IP is 192.168.0.1,
how many of those are there scattered all over the world?). The
proxies might add headers that give you a hint, or they might lie.
Browsers might also pretend that they are a proxy and lie. Beware
that some round-robin proxies may make requests for pieces of the
same page, and consecutive pages, come from different public IP
A string containing browser info is in $_SERVER['HTTP_USER_AGENT'].
Also consider feeding that to the get_browser() function. You
should be able to parse out browser name, version, OS, etc. but
beware that many of the "minority" browsers pretend to be Internet
Explorer or Mozilla to make websites behave or not reject them
$_SERVER['HTTP_ACCEPT_LANGUAGE'] contains the contents of the
Accept-Language header, if any.
Gordon L. Burditt