#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Resolve IP Address


    I am using
    $IP=gethostbyaddr($_SERVER['REMOTE_ADDR']);

    to get the ip address of the user but some times iam getting an ip address as following

    089-100-174051.ntlworld.ie

    what does this ip address means and how can i resolve it?

    i found one link which resolves it on
    webyield.net

    but i need to do it an script as i need to map ip address to country.

    Can anyone help in resolving the ip address using php script.

    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    397
    Rep Power
    189
    To get the IP, just use:

    Code:
    $IP=$_SERVER['REMOTE_ADDR'];
    (Works in MOST cases, but there are exceptions)

    gethostbyaddr() resolves the IP to a hostname, using Reverse DNS
    Thomas Tremain
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0
    Thanks for that information.will check it out.

IMN logo majestic logo threadwatch logo seochat tools logo