I was looking for a PHP WHOIS script a few days ago, here are some of the better free ones that I've found: http://www.vorx.net/vxwhois/ http://www.finalwebsites.com/snippets.php?id=13 http://www.phpclasses.org/browse.html/package/694.html http://www.ep-dev.com/scripts-4.php http://whoisx.co.uk/scripts.html I haven't got round to trying any of them out yet, but some of them look promising. I was going to build a custom caching system as well so that I wasn't hammering the other whois servers with too many requests (and also to speed things up).
Hi, i have been trying to use the whois code by will spenser, but each time I try to run it it keeps changing the php tag with something like P----!, then never returns anything. I wonder what I am doung wron... can some body please help me?????
Hi, i have been trying to use the whois code by posted will spenser, but each time I try to run it it keeps changing the php tag to something like P----!, and then never returns anything. I wonder what I am doung wron... can some body please help me?????
Fisrt just to say thanks about my last post i left some tags out , that made it not to work, but I have another problem; I ahve being trying to modify the whois code so i can use it for a tld that is not included in the whois.inc- ?>array("com.ng","whois.register.net.ng","No Match") the problem is the output coming out using the script from the server for a query like nigeria.com.ng is This domain has been registered. Whois Server Version 1.0 - Search Nigerian Domains NiRA makes this information available "as is" and does not guarantee its accuracy ++ transcorpnigeria.com.ng ++ Organization: Transnational Corporation of Nigeria Description: Transnational corporation is a Address: c/o The Nigerian Stock Exchange, 2/4 Customs St. Address: Stock Exchange Tower, 23rd Floor Postal: 23401 City: Lagos Country: Nigeria Administrative Contact: Handle: NO7-NIRA Person: Nicholas Okoye (n_okoye@yahoo.com) Organization: Transnational Corporation of Nigeria Address: c/o The Nigerian Stock Exchange, 2/4 Customs St. Address: Stock Exchange Tower, 23rd Floor Postal Code: 23401 City: Lagos Phone: +234-1-2660287 Technical Contact: Handle: HA5-NIRA Person: Helen Ajayi (info@ngex.com) Organization: Media Business Company Address: 74 Raymond Njoku Postal Code: City: Ikoyi Phone: 234-1-2694520 Record created on 2006-10-24 09:50:50 Record last updated on 0000-00-00 00:00:00 Domain servers in listed order: ns17.zoneedit.com 209.126.159.118 ns8.zoneedit.com 206.55.124.4 Domain is Active ++ nbcnigeria.com.ng ++ Organization: Description: Address: Postal: City: Country: Administrative Contact: Handle: DR0-NIRA Person: Domain Registrar (protected) (registrar@register.net.ng) Organization: Registrar Protected Address: c/o NITDA 28 Portharcourt Cresent Address: Off Gimbiya Street Postal Code: 90001 City: Abuja Phone: 09- Technical Contact: Handle: DR0-NIRA Person: Domain Registrar (protected) (registrar@register.net.ng) Organization: Registrar Protected Address: c/o NITDA 28 Portharcourt Cresent Address: Off Gimbiya Street Postal Code: 90001 City: Abuja Phone: 09- Record created on 2007-02-11 15:36:26 Record last updated on 0000-00-00 00:00:00 Domain servers in listed order: glory.linkserve.com.ng 195.166.232.1 host2.linkserve.com.ng 195.166.232.1 Domain is Active ++ newstartnigeria.com.ng ++ Organization: NEW START NIGERIA Limited Description: This will be the website for New Address: 447 Address: Constitution Avenue Postal: AB City: Abuja Country: Nigeria Administrative Contact: Handle: OP2-NIRA Person: Ola Popoola (newstart@icecool.ws) Organization: NEW START NIGERIA Limited Address: 447 Address: Constitution Avenue Postal Code: AB City: Abuja Phone: +234 8055960766 Technical Contact: Handle: DA1-NIRA Person: Destiny Amana (domains@icecool.ws) Organization: Icecool Contracts UK Ltd Address: 315 Akin Ogunlewe Street Address: Victoria island Postal Code: City: Lagos Phone: 2348033787067 Record created on 2006-10-24 09:50:50 Record last updated on 0000-00-00 00:00:00 Domain servers in listed order: a.dnsvr.com 65.125.228.68 b.dnsvr.com 66.223.50.47 Domain is Active ................shorten............................................. Record created on 2006-10-24 09:50:50 Record last updated on 0000-00-00 00:00:00 Domain servers in listed order: ns0.xname.org 195.20.105.149 ns1.xname.org 193.23.158.13 Domain is Active ++ nigeria.com.ng ++ Organization: Nigerian Youths Organisation Description: Address: 21 Address: Ajao Estate Postal: LA City: Lagos Country: Nigeria Administrative Contact: Handle: SA6-NIRA Person: Samuel Adedoyin (nigeriayouths@icecool.ws) Organization: Nigerian Youths Organisation Address: 21 Address: Ajao Estate Postal Code: LA City: Lagos Phone: 234 803378 7067 Technical Contact: Handle: DA1-NIRA Person: Destiny Amana (domains@icecool.ws) Organization: Icecool Contracts UK Ltd Address: 315 Akin Ogunlewe Street Address: Victoria island Postal Code: City: Lagos Phone: 2348033787067 Record created on 2006-10-24 09:50:50 Record last updated on 0000-00-00 00:00:00 Domain servers in listed order: ns19.zoneedit.com 69.10.134.196 ns8.zoneedit.com 216.122.4.151 Domain is Active ++ ambafrance-nigeria.com.ng ++ Organization: Description: Address: Postal: City: Country: Administrative Contact: Handle: SA1-NIRA Person: Stephen Afuape (stephen@micro.com.ng) Organization: Microcom Systems Limited Address: 8 Adeleke Adedoyin street Address: Victoria Island Postal Code: 12345 City: Lagos Phone: +234-1-262-4856 Technical Contact: Handle: SA1-NIRA Person: Stephen Afuape (stephen@micro.com.ng) Organization: Microcom Systems Limited Address: 8 Adeleke Adedoyin street Address: Victoria Island Postal Code: 12345 City: Lagos Phone: +234-1-262-4856 Record created on 2006-10-24 09:50:50 Record last updated on 0000-00-00 00:00:00 Domain servers in listed order: engine4.micro.com.ng 208.227.137.213 ns.micro.com.ng 208.227.137.195 Domain is Active ++ enigeria.com.ng ++ Organization: Description: Address: Postal: City: Country: Administrative Contact: Handle: DR0-NIRA Person: Domain Registrar (protected) (registrar@register.net.ng) Organization: Registrar Protected Address: c/o NITDA 28 Portharcourt Cresent Address: Off Gimbiya Street Postal Code: 90001 City: Abuja Phone: 09- Technical Contact: Handle: DR0-NIRA Person: Domain Registrar (protected) (registrar@register.net.ng) Organization: Registrar Protected Address: c/o NITDA 28 Portharcourt Cresent Address: Off Gimbiya Street Postal Code: 90001 City: Abuja Phone: 09- Record created on 2007-02-11 15:36:26 Record last updated on 0000-00-00 00:00:00 Domain servers in listed order: dns2.nitda.gov.ng 80.179.104.189 mainhub.netproj.ictp.trieste.it 140.105.47.3 Domain is Active ++ worknigeria.com.ng ++ Organization: Work Nigeria Ltd Description: WorkNigeria.com.ng will be the Address: 315 Address: Akin Ogunlewe Street Postal: Nigeria City: Lagos Country: Nigeria Administrative Contact: Handle: AA8-NIRA Person: Anthony Amodu (worknigeria@icecool.ws) Organization: Work Nigeria Ltd Address: 315 Address: Akin OgunLewe Street Postal Code: Nigeria City: Lagos Phone: +234 803 3366332 Technical Contact: Handle: DA1-NIRA Person: Destiny Amana (domains@icecool.ws) Organization: Icecool Contracts UK Ltd Address: 315 Akin Ogunlewe Street Address: Victoria island Postal Code: City: Lagos Phone: 2348033787067 Record created on 2006-10-24 09:50:50 Record last updated on 0000-00-00 00:00:00 Domain servers in listed order: ns19.zoneedit.com 69.10.134.196 ns16.zoneedit.com 216.110.187.226 Domain is Active ++ missnigeria.com.ng ++ Organization: Daily Times of Nigeria, PLC Description: Beauty Paegent Address: Lateef Jakande Road Address: Agidingbi, Ikeja Postal: City: Lagos Country: Nigeria Administrative Contact: Handle: TM1-NIRA Person: The Managing Director (dtn@ngex.com) Organization: Daily Times of Nigeria, PLC Address: Lateef Jakande Road Address: Agidingbi, Ikeja Postal Code: City: Lagos Phone: 234-1-4977280 Technical Contact: Record created on 2006-10-24 09:50:50 Record last updated on 0000-00-00 00:00:00 Domain servers in listed order: ns5.zoneedit.com 207.41.71.245 ns4.zoneedit.com 216.98.150.236 Domain is Active ++ cadburynigeria.com.ng ++ Organization: Cadbury Nigeria PLC Description: Cadbury Nigeria PLC is a manufacturing Address: Agidingbi Road Postal: None City: Ikeja Country: NG Administrative Contact: Handle: TF2-NIRA Person: Tunde Falashe (tunde.falase@cadburynigeria.com.ng) Organization: Cadbury Nigeria PLC Address: Agidingbi Road Postal Code: None City: Ikeja Phone: +234 1 262-3900 Technical Contact: Handle: TO1-NIRA Person: Tunde Ogedengbe (tunde@linkserve.net) Organization: Linkserve Limited Address: 22 Akin Adesola Street Postal Code: None City: Victoria Island Phone: +234 1 2623900 Record created on 2006-10-24 09:50:50 Record last updated on 0000-00-00 00:00:00 Domain servers in listed order: glory.linkserve.com.ng 195.166.232.1 ns1.netsatx.net 207.241.160.3 Domain is Active Found 10 Record(s) so it returns a bunch of 10 records most time , that needs to be cleaned leaving the requested domain name ' only what I have done is to modify it like this: (added .com.ng to the whois.inc) as above then added to the end of the main script like these; (keep in mind i am very very new to this- be gentle)- i have highlighted the new added code i have posted the code in the next post The script hasn't work, can some one please help me in 2 ways (1) can you please follow my logic- am sure it's probably too long, cumbersome and there are better ways of doing it- but i'll just like to know that the logic work and that the problem was something missing... hopefully. (2) maybe rewrite give a diffrent way smarter, maybe shorter way of doing it would appreciate this very much have spent the last week cranking my head
<html> <body> <form name="whoingclean.php" method="post" action="whoingclean.php"> Domain: <input type="text" name="dom"> <input type="submit" name="Submit" value="Submit"> </form> <? $dom=$_POST['dom']; if ($dom){ include "./whoisng.inc"; $whoisresult = lookup($dom); $isavail = $whoisresult[0]; // Contains "1" is it's available, blank if it's registered $whotext = $whoisresult[1]; // Contains the full response from the server. #The PRE tags are there to display the results in web browsers without replacing \n with <br>..its just cleaner and quicker that way. if ($isavail=="1"){ print "<b>This domain is available!</b>"; } endif; { $write($tempfilehandle,"$whotext"); $tempfilehandle=fopen($tempfile,'w') or die $tempfile="tempfile.txt" //create tempfile to write output to $whoisfin=fgets($tempfilehandle); $whoistextdomains=spilt("\++",$whoisfin)// use spilt to to search domains in the out put using ++as mark $whoisdomall=("$whoistextdomains[0]",//find string that contains $dom "$whoistextdomains[1]", "$whoistextdomains[2]", "$whoistextdomains[3]", "$whoistextdomains[4]", "$whoistextdomains[5]", "$whoistextdomains[7]", "$whoistextdomains[8]", "$whoistextdomains[9]", "$whoistextdomains[10]",) $whoispreamb= Whois Server Version 1.0 - Search Nigerian Domains NiRA makes this information available "as is" and does not guarantee its accuracy" //then search from the array the string that contains $dom // print the array containg the found $dom //string starting with ++$dom( spilt first line of every string), if store each string into variables, the split[0]=$++$dom is the $whoistextdomainsspilt1=("\++",$whoistextdomains[1]) if$whoistextdomainsspilt1[0]== "++"$dom"" {print"<b>"$whoispreamb"</b><b>"$dom"is available<\b>"$whoistextdomains[0]" } elseif {"$whoistextdomains[1]"="";//check if string exists endif;} $whoistextdomainsspilt1=("\++",$whoistextdomains[1]);//do he same operation for each of strings if{ $whoistextdomainsspilt2[0]=="$++dom"} {print"<b>"$whoispreamb"</b><b>"$dom"is available<\b>"$whoistextdomains[1]"} endif; If{"$whoistextdomains[2]"==[""]//if string exists(doesn't exist, end it) endif; elseif {$whoistextdomainsspilt2=("\++",$whoistextdomains[2])} If $whoistextdomainsspilt2[0]=="++"$dom"" {print"<b>"$whoispreamb"</b><b>"$dom"is available<\b>"$whoistextdomains[2]" }} endif; elseif {"$whoistextdomains[3]"==[""]"//check if domain (string) exists elseif{ $whoistextdomainsspilt3=("\++",$whoistextdomains[3])//split string containing domain if{ $whoistextdomainsspilt3[0]=="++"$dom"" //compare split with domain {print"<b>"$whoispreamb"</b><b>"$dom" is available<\b>"$whoistextdomains[3]"}} elseif{"$whoistextdomains[4]==[""]"//if string exists $whoistextdomainsspilt4=("\++",$whoistextdomains[4]) if $whoistextdomainsspilt4[0]=="++"$dom"" {print"<b>"$whoispreamb"</b><b>"$dom"<\b><b>"$whoistextdomains[4]"}} elseif{"$whoistextdomains[5]==[""]"//if string exists $whoistextdomainsspilt5=("\++",$whoistextdomains[5]) if $whoistextdomainsspilt5[0]=="++"$dom"" {print"<b>"$whoispreamb"</b><b>"$dom"<\b><b>"$whoistextdomains[5]"</b>}} elseif{"$whoistextdomains[6]==[""]"//if string exists $whoistextdomainsspilt6=("\++",$whoistextdomains[6]) if$whoistextdomainsspilt6[0]=="++"$dom"" {print"<b>"$whoispreamb"</b><b>"$dom"<\b><b>"$whoistextdomains[6]"</b>}} endif; elseif{"$whoistextdomains[7]==[""]"//if string exists $whoistextdomainsspilt7=("\++",$whoistextdomains[7]) if$whoistextdomainsspilt7[0]=="++"$dom"" {print"<b>"$whoispreamb"</b><b>"$dom" is available<\b><b>"$whoistextdomains[7]"} </b> endif; else $whoistextdomainsspilt8=("\++",$whoistextdomains[8]) if $whoistextdomainsspilt7[0]=="++"$dom"" print"<b>"$whoispreamb"</b><b>"$dom"is available<\b><b>"$whoistextdomains[8]" </b> endif; else $whoistextdomainsspilt9=("\++",$whoistextdomains[9]) if $whoistextdomainsspilt9[0]=="++"$dom"" print"<b>"$whoispreamb"</b><b>"$dom" is available<\b><b>"$whoistextdomains[9]" </b> endif; else echo ""$whoispreamb""$dom" is already registered" fclose($tempfilehandle); } } ?> </body> </html>
what i was trying to do is to write the output into a text file; split the file into a arry of strings search each string for the domain chose the string that has the domain diplay both the domain and the info following it(cutting out the rest of the txt file)
I'm also looking for a free WHOIS script written in ASP for my website. I want something like they have at http://whois.net/