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 Quote Link to comment 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? Quote Link to comment 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 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.