knowram Posted December 9, 2006 Share Posted December 9, 2006 I found this chunk of code. but it is from 2000 and I have not been able to get it to work. dose anyone have any idea.[code]<?php ################################################ # rWhois# inputs: IP address # outputs: array of rWhois info from first referral ################################################ function rwhois($query){ $fp = fsockopen ("rwhois.arin.net", 4321, $errno, $errstr, 30); if (!$fp) { $ret[] = "$errstr ($errno)\n"; }else{ fputs ($fp, "$query\r\n\r\n"); $count=1; while (!feof($fp) && $count < 17) { $back = fgets ($fp,128); $data = explode(":",$back); $ret[$data[1]] = $data[2]; $count++; }//wend fclose ($fp); }//fi return $ret; }//end function print_r(rwhois("64.58.79.230")); //yahoo ?> [/code]thanks for the help this would make life much easier for me if it will work Link to comment https://forums.phpfreaks.com/topic/30063-arin-whois/ Share on other sites More sharing options...
trq Posted December 10, 2006 Share Posted December 10, 2006 What does....[quote]have not been able to get it to work[/quote]meen? Link to comment https://forums.phpfreaks.com/topic/30063-arin-whois/#findComment-138254 Share on other sites More sharing options...
knowram Posted December 10, 2006 Author Share Posted December 10, 2006 Sorry. At first I was getting a can not connect error. but now after changing some things I just don't get the right out put.here is the new code[code]<?php ################################################ # rWhois# inputs: IP address # outputs: array of rWhois info from first referral ################################################ function rwhois($query){ $fp = fsockopen ("www.arin.net", 80, $errno, $errstr, 30); if (!$fp) { $ret[] = "$errstr ($errno)\n"; }else{ fwrite ($fp, "$query\r\n\r\n"); $count=1; while (!feof($fp) && $count < 17) { $back = fgets ($fp,128); $data = explode(":",$back); $ret[$data[1]] = $data[2]; $count++; }//wend fclose ($fp); }//fi return $ret; }//end function print_r(rwhois("64.58.79.230")); //yahoo [/code]and here is the out put that I get.Array ( [] => [//www.arin.net/index.shtml">here.] => )thanks for the help Link to comment https://forums.phpfreaks.com/topic/30063-arin-whois/#findComment-138264 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.