Display Visitors Location In Browser

Discussion in 'Programming' started by InputProductions, Feb 5, 2009.

  1. #1
    I'm looking for a (hopefully free) script that will display a visitor's location/city depending on their IP.

    Could someone help me out?
     
    InputProductions, Feb 5, 2009 IP
  2. th3sn0wbr4in

    th3sn0wbr4in Guest

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this: ip2phrase.com
     
    th3sn0wbr4in, Feb 5, 2009 IP
  3. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #3
    quoting Nullbyte user over here :
    <?php
    $ip = $_SERVER['REMOTE_ADDR'];
    $file = file_get_contents("http://www.melissadata.com/lookups/iplocation.asp?ipaddress=" . $ip);
    preg_match('^<tr><td align="right">Country</td><td><b>([A-Z]+)</b></td></tr>^',$file , $country);
    $country = $country[1];
    print $country;
    ?>
     
    crivion, Feb 6, 2009 IP
  4. RaulGonzales

    RaulGonzales Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ho Good job
     
    RaulGonzales, Feb 6, 2009 IP
  5. andrew47

    andrew47 Active Member

    Messages:
    319
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
  6. buldozerceto

    buldozerceto Active Member

    Messages:
    1,137
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    88
    #6
    buldozerceto, Feb 8, 2009 IP