Search code examples
phpjavascriptgeolocationlocationgeo

Is there an easy script which will display script 1 to US/ Canadian visitors and script 2 to the rest


I would like to know if there is an easy script which will display script 1 to US/ Canadian visitors and script 2 to the rest.

Does not need to be that accurate but using a service like http://freegeoip.net/json/18.8.8.82 is to complicated for me

Is there an easy way

a script example would greatly be appreciated


Solution

  • You may try: GEO Plugin

    The PHP web service allows you to directly program your back-end PHP scripts to deliver dynamic geo-localized pages using the PHP array provided by geoPlugin.

    GEO Plugin PHP Web Service

    It is easy to use.

    See Demo: http://jsfiddle.net/akhurshid/WktTV/