Internal IP

Posted on 2005-04-26
Last Modified: 2008-02-26
Hi All:


I know this is an ASP page, and it states it is done in Java, but is it possible to capture the users "INTERNAL" IP address if it is found ?

Thanks in advance !
Question by:SR301
    LVL 33

    Accepted Solution

    echo $_SERVER['REMOTE_ADDR'];
    should get what you want, upload it on ur php server and check from some other machine...not the server itself.

    u could also check
    when you can't resolve the client's IP due to a proxy server
     credit to leeprovoost for this
       if ($_SERVER["HTTP_X_FORWARDED_FOR"] != ""){
           $IP = $_SERVER["HTTP_X_FORWARDED_FOR"];
           $proxy = $_SERVER["REMOTE_ADDR"];
           $host = @gethostbyaddr($_SERVER["HTTP_X_FORWARDED_FOR"]);
           $IP = $_SERVER["REMOTE_ADDR"];
           $host = @gethostbyaddr($_SERVER["REMOTE_ADDR"]);

    Author Comment

    That will continue to return the IP Address of your modem, and not beyond your router/firewall... I'm interested in the Internal IP !

    Author Comment

    LVL 6

    Expert Comment

    It's not possible to get internal ip using PHP. After all, it's on the other side :-) does it with Java (which is on the client's machine, so it may know it's internal ip) sending information to server.

    Author Comment

    OK - Was hoping for a PHP version... I guess its something I need to ask in the Java section then hey ?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    As this topic comes over and over again in different forms, I've finally decided to write a short (yea, right...) article / tutorial about pagination with PHP with MySQL database. There are dozens of these kind of tutorials, I know - I wanted to mak…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    6 Experts available now in Live!

    Get 1:1 Help Now