worldcomingtoanend Posted May 13, 2010 Share Posted May 13, 2010 I only know how to extract public ip addresses using this: $_SERVER['REMOTE_ADDR']; $_SERVER['SERVER_ADDR']; but i need a way to extract a pc ip address...I need this to do a condition for a service available to the local intranet members. thank you.. Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted May 13, 2010 Share Posted May 13, 2010 You can't with php because php is server side so it can't see the local lan for your client. You may be able to with javascript. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted May 13, 2010 Share Posted May 13, 2010 This might be of some use to you: <?php if ($_SERVER["HTTP_X_FORWARDED_FOR"] != ""){ $IP = $_SERVER["HTTP_X_FORWARDED_FOR"]; $proxy = $_SERVER["REMOTE_ADDR"]; $host = @gethostbyaddr($_SERVER["HTTP_X_FORWARDED_FOR"]); }else{ $IP = $_SERVER["REMOTE_ADDR"]; $host = @gethostbyaddr($_SERVER["REMOTE_ADDR"]); } ?> Ken 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.