jwk811 Posted February 17, 2007 Share Posted February 17, 2007 Look at this site http://www.formyip.com/ipcountry.php See how it gets all that info from just the ip address, how can I do that? I really need that bad but i dont know how to get it. Do i need a special program or does php have anything to do with it already? Thank you very much for any help you can give me at all! Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/ Share on other sites More sharing options...
Greaser9780 Posted February 17, 2007 Share Posted February 17, 2007 There must be a way to do it in php. In my phpBB forum it can get a users ip when they register. You can use it to ban users. U try a google search for php ip address? Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187516 Share on other sites More sharing options...
Greaser9780 Posted February 17, 2007 Share Posted February 17, 2007 I found this through google quick If register globals is on the code is: $ip=@$REMOTE_ADDR; echo "<font face='Verdana' size='3'><b>IP Address= $ip</b>"; If register globals is off the code is: $ip=$_SERVER['REMOTE_ADDR']; This is where I found it: http://www.plus2net.com/php_tutorial/php_ip.php Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187523 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 that site has a mysql database full of IP starters like 24.185.*.* would mean this ISP company located in USA New York etc.. you would have to do it for all ips its a huge database http://ip2location.com sells complete database for like 600$ the first 2 pair'd numbers from 0.0 - 255.255 tell alll the information the last 2 are the computers connected Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187527 Share on other sites More sharing options...
Ryaan Posted February 17, 2007 Share Posted February 17, 2007 It got my Province, and City wrong. Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187539 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 ip2location never makes mistakes Ryaan Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187542 Share on other sites More sharing options...
Ryaan Posted February 17, 2007 Share Posted February 17, 2007 Well then I must not know where I live. Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187588 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 thats the case your internet company is located there not your computer thats what it means. Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187589 Share on other sites More sharing options...
printf Posted February 18, 2007 Share Posted February 18, 2007 Here is download example.... (writes to a image, 3 examples) If it can't find a city, it puts your country! http://rapidshare.com/files/16979926/geo_image.rar.html example..... (not the best database, but usually gets close, if not 100% correct) http://zip.ya-right.com/example.php Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187620 Share on other sites More sharing options...
phat_hip_prog Posted February 18, 2007 Share Posted February 18, 2007 You could use 'exec' and run 'whois': function whoisit($ip) { $sret = ""; exec ("whois ".$ip, $oa, $ret); $sret .= "<h3>WHO RESULTS FOR ".$ip."</h3>"; // result: ".$ret."<br><br>"; if ($ret == 0) { foreach ($oa as $o) { $sret .= " ".$o."<br>"; } } return $sret; } Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187630 Share on other sites More sharing options...
jwk811 Posted February 18, 2007 Author Share Posted February 18, 2007 wow thats a lot of money lol and yes i know how to get the ip address any other suggestions as to what i could do? Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187636 Share on other sites More sharing options...
phat_hip_prog Posted February 18, 2007 Share Posted February 18, 2007 Well the obvious ones are to try to run ping, traceroute, nmap, etc, but these use raw sockets and are generally protected from being run, i've tried setting SID and GID. I've not yet tried php sockets, but since to do network probing requires crafting packets this may also not work. Other way i'm thinking is to run a program (signal a daemon), which reports back with an id.txt. Dunno? Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187643 Share on other sites More sharing options...
jwk811 Posted February 18, 2007 Author Share Posted February 18, 2007 anyone else? Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187696 Share on other sites More sharing options...
jwk811 Posted February 18, 2007 Author Share Posted February 18, 2007 on that site I showed you, did you guys get the right output? mine said brooklyn newyork and i live in massachusetts... Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187705 Share on other sites More sharing options...
phat_hip_prog Posted February 18, 2007 Share Posted February 18, 2007 traceroute / tracert, and check each hop location, last should be closest exchange? Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187722 Share on other sites More sharing options...
jwk811 Posted February 18, 2007 Author Share Posted February 18, 2007 traceroute / tracert, and check each hop location, last should be closest exchange? huh? Link to comment https://forums.phpfreaks.com/topic/38967-get-info-from-ip-address-help/#findComment-187742 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.