hackerkts Posted July 21, 2006 Share Posted July 21, 2006 Anyone of here know how to make a scripts that double check if the user is using a proxy, and it will tells the real external IP address ?I'm not referring to[code]$_SERVER['REMOTE_ADDR'][/code]Let's say my real external IP is 4321.4321.4321.4321 and I'm using a proxy which is 1234.1234.1234.1234If I just use $_SERVER['REMOTE_ADDR'] it will only tells that my IP is 1234.1234.1234.1234Overall:I hope it could tells the external IP even you are on a proxy.Thanks in advance and any helps will be appreciated. Quote Link to comment Share on other sites More sharing options...
tommych Posted July 21, 2006 Share Posted July 21, 2006 i don't think what you want to do is possible.Proxy Example:User | Proxy | Server <- ->Since php is server side, not client side you woudn't be able to get the "real" ip. (i think)Try Javascript to get the client ip, that might work (but i'm not sure)[code]<SCRIPT>var ip = new java.net.InetAddress.getLocalHost();var ipStr = new java.lang.String(ip);document.writeln(ipStr.substring(ipStr.indexOf("/")+1));</SCRIPT>[/code]i'm not sure if you could insert a php variable in their so you could compare it ... Quote Link to comment Share on other sites More sharing options...
hackerkts Posted July 22, 2006 Author Share Posted July 22, 2006 Thanks for the reply, but I believe there's a way to do it in PHP.Since SMF also has this feature too. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted July 22, 2006 Share Posted July 22, 2006 The reason for a proxy server is to hide that information! A proxy server sends its ip in the headers but not it's users ip. You can see everything sent in the headers that the server recieves this way:[code]<?php print_r($_SERVER);?>[/code] Quote Link to comment Share on other sites More sharing options...
Destruction Posted July 22, 2006 Share Posted July 22, 2006 The IP behind the IP can be found using the below. It will only work if it is behind a proxy so remember to check first.$_SERVER['HTTP_X_FORWARDED_FOR']HTHDest Quote Link to comment Share on other sites More sharing options...
mainewoods Posted July 22, 2006 Share Posted July 22, 2006 Your subject is discussed in the user contributed notes at the bottom of this page:http://us2.php.net/getenv Quote Link to comment Share on other sites More sharing options...
hackerkts Posted July 24, 2006 Author Share Posted July 24, 2006 Thanks, appreciate it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.