I Am Updating Instant Domain Name Checker

Discussion in 'PHP' started by locpicker, Aug 2, 2011.

  1. #1
    I am updating an old script that has stopped working. It uses this code to look up domain names and it does not work anymore

    if (function_exists('curl_init')) {		$ch = curl_init('http://www.whois.net/whois_new.cgi?d=' . $_GET['domain']);		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);		curl_setopt($ch, CURLOPT_USERAGENT, '');		curl_setopt($ch, CURLOPT_REFERER, '');		$data = curl_exec($ch);	} else {		$data = file_get_contents('http://www.whois.net/whois_new.cgi?d=' . $_GET['domain']);	}	if (eregi('no match found', $data)) {		echo 'available';	} else {		echo 'not-available';	}?>
    Code (markup):
    I found a new site and added it in place of the old but it still does not work. Anyone know why?

    if (function_exists('curl_init')) {	
    	$ch = curl_init('http://www.networksolutions.com/whois-search/' 
    . $_GET['domain']);		curl_setopt($ch, 
    CURLOPT_RETURNTRANSFER, true);		curl_setopt($ch, 
    CURLOPT_FOLLOWLOCATION, true);		curl_setopt($ch, 
    CURLOPT_USERAGENT, '');		curl_setopt($ch, CURLOPT_REFERER, '');	
    	$data = curl_exec($ch);	} else {		$data = 
    file_get_contents('http://www.networksolutions.com/whois-search/' . 
    $_GET['domain']);	}	if (eregi('no match found', $data)) {	
    	echo 'available';	} else {		echo 'not-
    available';	}?>
    Code (markup):

     
    locpicker, Aug 2, 2011 IP
  2. milindmk

    milindmk Active Member

    Messages:
    100
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    85
    #2
    Hello,

    I have checked the script and as per my knowledge the script is ok but the problem seems to be with whois provider (networksolutions.com and whois.net). Please make sure that they support or accept requests using PHP or curl script.
     
    milindmk, Aug 2, 2011 IP
  3. locpicker

    locpicker Well-Known Member

    Messages:
    789
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    160
    #3
    That is the link that they provide minus the Get['domain'] part. It is an actual free link for domain lookups. You can just append the domain name to the end of the link and it returns a result page.

    I have manually tried the original link and it does not seem to work anymore.
     
    locpicker, Aug 2, 2011 IP
  4. Vishalrd

    Vishalrd Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I got your problem could you please verify for me that Get['domain'] & input source(textbox) ID is same or not ? if no please correct it
     
    Vishalrd, Aug 3, 2011 IP
  5. Vishalrd

    Vishalrd Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This is open source domain whois checker script, I hope this will help you hxxp://ajaxdomaincheck.sourceforge.net/(@mod I am not sure that I am allowing to post link here if I am wrong please delete this link)
     
    Vishalrd, Aug 3, 2011 IP
  6. locpicker

    locpicker Well-Known Member

    Messages:
    789
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    160
    #6
    The code I put on here is just the way it was in the file.

    Thanks. I will check it out.
     
    locpicker, Aug 5, 2011 IP