Results 1 to 10 of 10

Thread: IP address

  1. #1
    Contributing Member
    Join Date
    May 2006
    Answers
    82

    IP address

    I want to get ip address. How can I get it or what functions or methods can be used to get ip address using PHP

    Timmy


  2. #2
    Contributing Member
    Join Date
    May 2006
    Answers
    85

    Re: IP address

    You can use REMOTE_ADDR or REMOTE_HOST to achieve the above that is get ip address. But I want to know about super global variables in php. Someone throw highlight on this.


  3. #3
    Junior Member
    Join Date
    Nov 2007
    Answers
    2

    Re: IP address

    $_SERVER variable are super global variable in php....


  4. #4
    Junior Member
    Join Date
    Aug 2007
    Answers
    7

    Re: IP address

    Remote_addr


  5. #5
    Junior Member
    Join Date
    Sep 2008
    Answers
    1

    Arrow Re: IP address

    baria Mahesh::
    you will use this code for getting ip address which is given below::
    $ip = gethostbyname('www . example . com');
    $out = "The following URLs are equivalent:
    \n";
    $out .= '[[siteurl]], http://' . $ip . '/, and http://' . sprintf("%u", ip2long($ip)) . "/
    \n";
    echo $out;
    ?>

    ip2long() function given to you ip address or particular given hostname.



  6. #6
    Junior Member
    Join Date
    Dec 2008
    Answers
    11

    Re: IP address

    If you want the IP adreess than use gethostbyaddr() & if you want to url than use gethostbyname() function.


  7. #7
    Junior Member
    Join Date
    Apr 2009
    Answers
    1

    Re: IP address

    u can use

    $ip=getHostByName(@"REMOT_ADDR");

    i thinks its work...


  8. #8
    Junior Member
    Join Date
    Sep 2010
    Answers
    1

    Re: IP address

    It is better to use REMOTE_ADDR
    $ip = $_SERVER['REMOTE_ADDR'];


  9. #9
    Junior Member
    Join Date
    Jan 2011
    Answers
    10

    Re: IP address

    If you want to fetch IP address using PHP than you have to use Given Code:

    $ip=@$REMOTE_ADDR;
    echo "IP Address= $ip";

    Detecting the IP address is very important requirement for many scripts where we store the members or visitors details.


  10. #10
    Junior Member
    Join Date
    May 2011
    Answers
    1

    Re: IP address

    For finding ip address make use of the website for free of cost.Also you can get the DNS query, hosting, and ping test information from the website.For normal PC(personal computer) IP address you can find by giving ping in the command prompt.


  11.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact