vbnullchar Posted September 5, 2007 Share Posted September 5, 2007 how can i get the computer name? Quote Link to comment https://forums.phpfreaks.com/topic/67987-get-computername/ Share on other sites More sharing options...
Yesideez Posted September 5, 2007 Share Posted September 5, 2007 What do you mean exactly by the computer name? Quote Link to comment https://forums.phpfreaks.com/topic/67987-get-computername/#findComment-341833 Share on other sites More sharing options...
vbnullchar Posted September 5, 2007 Author Share Posted September 5, 2007 im need to trace where the user used the script.. how will i know his local ip/computer name, this code gethostbyaddr($_SERVER['REMOTE_ADDR']); returns the proxy ip address but i dont need this i need the local ip address Quote Link to comment https://forums.phpfreaks.com/topic/67987-get-computername/#findComment-341866 Share on other sites More sharing options...
hackerkts Posted September 5, 2007 Share Posted September 5, 2007 Do you mean this? function get_ip() { if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP"); else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR"); else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR"); else $ip = "0.0.0.0"; //Unknown return $ip; } Quote Link to comment https://forums.phpfreaks.com/topic/67987-get-computername/#findComment-341868 Share on other sites More sharing options...
vbnullchar Posted September 5, 2007 Author Share Posted September 5, 2007 Do you mean this? function get_ip() { if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP"); else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR"); else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR"); else $ip = "0.0.0.0"; //Unknown return $ip; } it returns the ip address of the proxy server not the client Quote Link to comment https://forums.phpfreaks.com/topic/67987-get-computername/#findComment-341881 Share on other sites More sharing options...
Yesideez Posted September 5, 2007 Share Posted September 5, 2007 You can't get the name of the computer using PHP. The best you can do is get their IP address. Quote Link to comment https://forums.phpfreaks.com/topic/67987-get-computername/#findComment-341911 Share on other sites More sharing options...
vbnullchar Posted September 5, 2007 Author Share Posted September 5, 2007 You can't get the name of the computer using PHP. The best you can do is get their IP address. i see, but how if im behind a proxy server Quote Link to comment https://forums.phpfreaks.com/topic/67987-get-computername/#findComment-341948 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.