woody79 Posted July 22, 2007 Share Posted July 22, 2007 I would like to get the users wan ip address, but $_SERVER['REMOTE_ADDR'] just gives me DNS, anyone know why and how to get round this problem Link to comment https://forums.phpfreaks.com/topic/61206-php-ip-address/ Share on other sites More sharing options...
BillyBoB Posted July 22, 2007 Share Posted July 22, 2007 are you sure it is their dns could you please host a file with the $_SERVER['REMOTE_ADDR']; echoed? Link to comment https://forums.phpfreaks.com/topic/61206-php-ip-address/#findComment-304528 Share on other sites More sharing options...
Wuhtzu Posted July 22, 2007 Share Posted July 22, 2007 In my world the WAN IP and external IP (the IP address computers outside his LAN sees) is one and the same thing - so $_SERVER['REMOTE_ADDR'] is how you get the WAN IP. If you mean the LAN IP, like 10.0.0.1, 10.0.0.17, 192.168.0.4 ect. there is no way of getting it with PHP. The reason why I suggest / think you mean LAN IP is because it would be very handy, e.g. for polls where you don't wanna use cookies but want to let everyone on the same LAN vote Link to comment https://forums.phpfreaks.com/topic/61206-php-ip-address/#findComment-304531 Share on other sites More sharing options...
redarrow Posted July 22, 2007 Share Posted July 22, 2007 you can use php to get anythink u want all you do is use the exec() function to pass relevent query to msdos then write the info to a text file or database and show info. hackers do it all day but if the relevent server has setup example apache properly you want get all information ok. Link to comment https://forums.phpfreaks.com/topic/61206-php-ip-address/#findComment-304550 Share on other sites More sharing options...
Wuhtzu Posted July 22, 2007 Share Posted July 22, 2007 I don't think you can get a users LAN ip-address if he just visits your site... I don't think woody79 want the servers LAN ip... Link to comment https://forums.phpfreaks.com/topic/61206-php-ip-address/#findComment-304566 Share on other sites More sharing options...
woody79 Posted July 23, 2007 Author Share Posted July 23, 2007 I don't think you can get a users LAN ip-address if he just visits your site... I don't think woody79 want the servers LAN ip... When the computer is inside the workplace and it is set to bypass proxy for local servers, $_SERVER['REMOTE_ADDR'] gives me their LAN IP. When they access the page from outside the workplace, it gives me DNS. I have no idea why! Link to comment https://forums.phpfreaks.com/topic/61206-php-ip-address/#findComment-305099 Share on other sites More sharing options...
ss32 Posted July 23, 2007 Share Posted July 23, 2007 umm, this may seem like a stupid question, but where is the server? Link to comment https://forums.phpfreaks.com/topic/61206-php-ip-address/#findComment-305107 Share on other sites More sharing options...
woody79 Posted July 25, 2007 Author Share Posted July 25, 2007 umm, this may seem like a stupid question, but where is the server? What do you mean exactly? Link to comment https://forums.phpfreaks.com/topic/61206-php-ip-address/#findComment-307028 Share on other sites More sharing options...
ViN86 Posted July 25, 2007 Share Posted July 25, 2007 If you mean the LAN IP, like 10.0.0.1, 10.0.0.17, 192.168.0.4 ect. there is no way of getting it with PHP. The reason why I suggest / think you mean LAN IP is because it would be very handy, e.g. for polls where you don't wanna use cookies but want to let everyone on the same LAN vote youre not supposed to be able to get this. it's a security feature of routers and such. i mean, thats why they do it. if you want to allow ppl on the same LAN to vote, try using cookies and IP logs. i know its not flawless cause as soon as the cookie expires they can vote again, but thats all i can think of atm heh. umm, this may seem like a stupid question, but where is the server? What do you mean exactly? if the server is on the LAN, then when it retrieves the user's IP, it will be the LAN address (ie 192.168.1.xxx, etc.) Link to comment https://forums.phpfreaks.com/topic/61206-php-ip-address/#findComment-307077 Share on other sites More sharing options...
woody79 Posted July 26, 2007 Author Share Posted July 26, 2007 Don't ask why it is set up like this, it was previous people!!! Link to comment https://forums.phpfreaks.com/topic/61206-php-ip-address/#findComment-307870 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.