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! Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Ryaan Posted February 17, 2007 Share Posted February 17, 2007 It got my Province, and City wrong. Quote Link to comment Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 ip2location never makes mistakes Ryaan Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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; } Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
jwk811 Posted February 18, 2007 Author Share Posted February 18, 2007 anyone else? Quote Link to comment 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... Quote Link to comment 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? Quote Link to comment 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? 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.