The Little Guy Posted May 6, 2010 Share Posted May 6, 2010 Do mobile phones have an ip address? Link to comment https://forums.phpfreaks.com/topic/200927-cell-phone-ip-address/ Share on other sites More sharing options...
Daniel0 Posted May 6, 2010 Share Posted May 6, 2010 If they're connected to the internet, yes. Link to comment https://forums.phpfreaks.com/topic/200927-cell-phone-ip-address/#findComment-1054250 Share on other sites More sharing options...
The Little Guy Posted May 6, 2010 Author Share Posted May 6, 2010 OK! That means this will work... Right? <?= $_SERVER['REMOTE_ADDR']; ?> Link to comment https://forums.phpfreaks.com/topic/200927-cell-phone-ip-address/#findComment-1054253 Share on other sites More sharing options...
Daniel0 Posted May 6, 2010 Share Posted May 6, 2010 There will always be a remote address. Where else should the response go? Link to comment https://forums.phpfreaks.com/topic/200927-cell-phone-ip-address/#findComment-1054258 Share on other sites More sharing options...
xcoderx Posted May 6, 2010 Share Posted May 6, 2010 function ipCheck() { if (getenv('HTTP_CLIENT_IP')) { $ip = getenv('HTTP_CLIENT_IP'); } elseif (getenv('HTTP_X_FORWARDED_FOR')) { $ip = getenv('HTTP_X_FORWARDED_FOR'); } elseif (getenv('HTTP_X_FORWARDED')) { $ip = getenv('HTTP_X_FORWARDED'); } elseif (getenv('HTTP_FORWARDED_FOR')) { $ip = getenv('HTTP_FORWARDED_FOR'); } elseif (getenv('HTTP_FORWARDED')) { $ip = getenv('HTTP_FORWARDED'); } else { $ip = $_SERVER['REMOTE_ADDR']; } return $ip; } Link to comment https://forums.phpfreaks.com/topic/200927-cell-phone-ip-address/#findComment-1054298 Share on other sites More sharing options...
xcoderx Posted May 6, 2010 Share Posted May 6, 2010 soo many ways to detect ip :-) anything works for a mobile device just like it does with web browsers. but if by any means u want to get their IMEI thats not possible. detecting phone numbers is slightly possible. Link to comment https://forums.phpfreaks.com/topic/200927-cell-phone-ip-address/#findComment-1054305 Share on other sites More sharing options...
Daniel0 Posted May 6, 2010 Share Posted May 6, 2010 Oh, nice. You've just made it way easier for me spoofing my address on your website Link to comment https://forums.phpfreaks.com/topic/200927-cell-phone-ip-address/#findComment-1054310 Share on other sites More sharing options...
xcoderx Posted May 6, 2010 Share Posted May 6, 2010 ok :-) Link to comment https://forums.phpfreaks.com/topic/200927-cell-phone-ip-address/#findComment-1054318 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.