WHOIS query object

cynthiasepia

New Member
Ok....while learning web development every so often i get stuck, knowing that i'm missing a one little basic piece of information and just grinding to find out what. It happens because experienced programmers don't care about restating the basics. Anyway, i am trying to retrieve information from a WHOIS server, namely whois.apnic.net. Now this query works fine and returns all 1528 bytes\[code\]<?php$abc=fsockopen("whois.godaddy.com", 43);$xyz="website.com";fputs($abc,$xyz);$output = fread($abc,1528);print_r($output);if(!$output){echo "there is no output";}?>\[/code\]But this one only returns the first two lines\[code\]<?php$abc=fsockopen("whois.apnic.net", 43);$xyz="194.6.248.10";fputs($abc,$xyz);$output = fread($abc,1528);print_r($output);if(!$output){echo "there is no output";}?>\[/code\]I have tried a lot of modifications in the code for example fgets instead of fread, url instead of ip address, when i put while(!feof($abc)) condition into the prior code it returns everything, but when i put this in the second code it just times out or keeps working if i remove the time limit. The above IP address is from Europe but the online Apnic WHOIS tool gives information about it and the WHOIS API documentation also states that Apnic can contact other Registries and retrieve info about any IP address. The apnic website talks about sending and returning objects, just 'objects', no reference. I presumed its talking about XML objects. I just want a small, basic, simple example of how to query this API and get and output the 'objects'. Thanks!
 
Back
Top