Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Possible to detect default gateway IP of visitors?

    Hi,

    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?

    Thanks
    Chris

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,772
    Thanks
    23
    Thanked 550 Times in 549 Posts
    Here is the code to display your ip address it's php.
    PHP Code:
    $ip $_SERVER['REMOTE_ADDR'];
    echo 
    "<b>IP Address= $ip</b>"
    Last edited by Inigoesdr; 09-15-2012 at 02:48 PM.

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,093
    Thanks
    51
    Thanked 506 Times in 493 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.
    $ip=@$REMOTE_ADDR;
    echo "<b>IP Address= $ip</b>";
    sunfighter that is the remote ip not the default gateway ip as chris has requested.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 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
    •