I need an html code for visitors town and state

1 replies
I need a code to put into my cpa landing pages, that will display a visitors town or city and state, when they come to my site. I want the code to be html, since I don't have any experience with css. Hopefully it would display something like Boston, Ma or Shelton, CT

Thanks Glenn
#code #html #state #town #visitors
  • Profile picture of the author alchebank
    Add this between <head>.....</head>

    <script language="Javascript" src="http://j.maxmind.com/app/geoip.js"></script>
    Add this after <body>

    <script language="Javascript">
    var country=geoip_country();
    var region=geoip_region();
    var city=geoip_city();
    if(country=="")
    country="US";
    if(region=="")
    region="New York";
    if(city=="")
    city="New York";
    </script>
    Add this to where you want it appears

    <script language="Javascript">document.write(geoip_country _code());</script>
    <script language="Javascript">document.write(geoip_country _name());</script>
    <script language="Javascript">document.write(geoip_city()) ;</script>
    <script language="Javascript">document.write(geoip_region( ));</script>
    <script language="Javascript">document.write(geoip_region_ name());</script>
    <script language="Javascript">document.write(geoip_latitud e());</script>
    <script language="Javascript">document.write(geoip_longitu de());</script>
    <script language="Javascript">document.write(geoip_postal_ code());</script>
    <script language="Javascript">document.write(geoip_area_co de());</script>
    <script language="Javascript">document.write(geoip_metro_c ode());</script>
    Here is the result for each document.write(xxxxxxxx)

    function geoip_country_code() { return 'US'; }
    function geoip_country_name() { return 'United States'; }
    function geoip_city() { return 'Chicago'; }
    function geoip_region() { return 'IL'; }
    function geoip_region_name() { return 'Illinois'; }
    function geoip_latitude() { return '41.8500'; }
    function geoip_longitude() { return '-87.6500'; }
    function geoip_postal_code() { return ''; }
    function geoip_area_code() { return '312'; }
    function geoip_metro_code() { return '602'; }
    {{ DiscussionBoard.errors[9569156].message }}

Trending Topics