Results 1 to 7 of 7

Thread: myip.ma

  1. #1

    myip.ma

    Can you please tell if this site http://www.myip.ma gets the real IP (even if you are behind a proxy) and the result is similar to http://www.whatismyip.ma ?

    Thanks
    For a free Internet !

  2. #2
    Join Date
    May 2006
    Location
    Teh Interweb
    Posts
    314
    In my experience it got my external IP. After configuring my system to use an http proxy it reported the proxy's ip address. This is similar to whatismyip.com

    [[email protected]] ~ $ cat .signature
    cat: .signature: No such file or directory

  3. #3
    Join Date
    Dec 2005
    Posts
    326
    I believe you can use $_SERVER['REMOTE_ADDR'];
    just echo that. Tell me if that does the trick

  4. #4
    Join Date
    Dec 2002
    Location
    chica go go
    Posts
    11,858
    Quote Originally Posted by stuffradio
    I believe you can use $_SERVER['REMOTE_ADDR'];
    just echo that. Tell me if that does the trick
    Some proxies send a forwarded-for value which shows the user's true ip address. This can be picked up using $_SERVER['HTTP_X_FORWARDED_FOR'] . However, this shouldn't be used for security, as it can easily be forged. I actually rewrote the squid source code to send back a department of defense ip address

    If the user is using a proxy, $_SERVER['REMOTE_ADDR'] will only send the proxy's ip address.

    Another cool trick with ip addresses is longip. it functions just like a normal ip address, but it looks a lot different and will throw a lot of people off.

    You can read up on that at www.php.net/ip2long

  5. #5
    Quote Originally Posted by ub3r View Post
    Some proxies send a forwarded-for value which shows the user's true ip address. This can be picked up using $_SERVER['HTTP_X_FORWARDED_FOR'] . However, this shouldn't be used for security, as it can easily be forged. I actually rewrote the squid source code to send back a department of defense ip address

    If the user is using a proxy, $_SERVER['REMOTE_ADDR'] will only send the proxy's ip address.

    Another cool trick with ip addresses is longip. it functions just like a normal ip address, but it looks a lot different and will throw a lot of people off.

    You can read up on that at www.php.net/ip2long
    Thanks for the explanation. But what would be the real use of that ''long2ip'' practically speaking ?
    For a free Internet !

  6. #6
    Join Date
    May 2008
    Location
    FL
    Posts
    337
    Quote Originally Posted by shellyco View Post
    Thanks for the explanation. But what would be the real use of that ''long2ip'' practically speaking ?
    Storing an IP address as a numeric value instead of a string comes to mind. You could conceivably save several bytes per record over using a varchar column (that said, in most normal cases the benefits are probably marginal compared to the extra processing and complexity)

  7. #7
    Join Date
    Feb 2003
    Location
    Canada
    Posts
    958
    Storing IP addresses in their long format also allows them to be sorted correctly, such as in mySQL queries. Storing them as strings means that they would be sorted ascending .1, .10, .2, where as in their long format they'd be .1, .2, .10.

Posting Permissions

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