Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Thanked 0 Times in 0 Posts

    Thumbs up Possible to detect default gateway IP of visitors?


    I own a garage door company in Montreal and recently have a new line of garage doors where users can type the default gateway of the SSID broadcasted from my new garage doors( basically my garages doors have a built-in router) and login from their computer or phones by typing in the default gateway or DNS, this way they can control their garage doors from the internet if they are in range of the signal broadcasted from my doors.

    The following would help me A LOT!:

    1.Is it possible to have a php script on my website that automatically detects the default gateway IP of the visitor's?

    2. Anybody willing to offer me a price to make this script?


  2. #2
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Thanked 998 Times in 995 Posts
    Here is the code to display your ip address it's php.
    PHP Code:
    $ip $_SERVER['REMOTE_ADDR'];
    "<b>IP Address= $ip</b>"
    Last edited by Inigoesdr; 09-15-2012 at 02:48 PM.

  3. #3
    Master Coder
    Join Date
    Feb 2011
    Your Monitor
    Thanked 610 Times in 596 Posts
    Quote Originally Posted by chrisjarson View Post
    detects the default gateway IP of the visitor's?
    Quote Originally Posted by sunfighter View Post
    Here is the code to display your ip address it's php.
    echo "<b>IP Address= $ip</b>";
    sunfighter that is the remote ip not the default gateway ip as chris has requested.
    Quote Originally Posted by deathshadow View Post
    So seriously, loosen up that tie, let out the belt, and try relating to normal people on the street instead of the gentleman's club crowd.

  4. #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,668 Times in 2,637 Posts
    That also won't work. Register globals are required to create $REMOTE_ADDR, and register_globals are gone as of 5.4 (happy happy).

    For the OP, no I don't believe there is a method of retrieving the gateway in PHP. However, if you trace it, then the second last hop should be the last device before the machine which *may* be the gateway. That assumes it replies of course. This is also an unreliable way of retrieving this information. A better solution would be to have the software installed by the user themselves, or for a web control implement the software into the opener itself. This can then be attached to via http directly to control it from any location. I wouldn't have a clue the amount of work that would require at that end.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts