FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » US, Canada or International
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: US, Canada or International [message #170245 is a reply to message #170244] Fri, 22 October 2010 17:23 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On 22/10/10 17:42, Jeff Thies wrote:
> I'd like to sniff out whether a visitor is in the US, Canada or
> elsewhere. I realize this can't be absolutely reliable but what might be
> the best option using php of course.
>
> That, I suppose, could either hash through the user agent or the
> remote address. Something else?
>
> Suggestions or code?

whois the ip address?

Have a look at http://www.geobytes.com/iplocator.htm

Maybe start with:

<?php

$url =
' http://www.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt& ;IpAddress='
.. $_SERVER['REMOTE_ADDR'];
$tags = get_meta_tags($url);

echo "<pre>\n";
print_r ($tags);
echo "</pre>\n";

?>

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Displaying a longblob as an image
Next Topic: DOMDocument loadHTML and double UTF8 encode
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 12:51:03 GMT 2024

Total time taken to generate the page: 0.05616 seconds