> Does anyone know of an intelligent way to establish a user's location > (roughly) from either IP address or some other variable > available to the > server from the browser? (Other than polling the user)
Not really - the problems you face are: 1. Processing Delays - if you need to do whois lookups on an ip address to try and guess where they are coming from you slow down page processing while this happens. Even if you cache the information you'll still be dealing with reasonable numbers on any busy site. 2. IP/Proxy Issues - a good many ISP's proxy web traffic - so all web clients using that ISP may appear to come from a single IP address (or a group of IP addresses in cases where an ISP runs a group of proxy servers). The proxy servers may, or may not, be in similar geographic locations to the web client (another state or possibly even another country). 3. IP/Firewall Issies - a number of entities run firewalls of various sorts. In these cases you'll often only see the IP address of the firewall and nothing else. As with the previous point, you could have multiple web clients all appearing to come from one IP address. Also as above, the web client may not be in the same location as the firewall (I can think of many corporate/govt. entities in Australia that run private IP networks with a single Internet gateway for the entire entity). 4. IP Address Assignments - just because a US corporation "owns" a particular address space doesn't mean that all of those IP addresses are actually being used in a single geographic location. Some multinationals use assigned IP addresses across multiple countries. As such, "ownership" of a range does not necessarily equate to geographical location. 5. IP/Domain Resolution - even if you resolve the IP to a domain, the country code (or lack of one) in a domain won't necessarily tell you where the actual web client it. There's five different reasons why it's unreliable and I don't claim this to be either exhaustive or completely detailed. There's no doubt more reasons I've not listed. Of course, if you're dealing with a relatively small group of web clients with known information that you have some control over - ie. a corporate Intranet where you know what IP's are assigned to what locations - then you've got a better chance of doing something. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php