Jump to content

Domainchecker


Recommended Posts

<form action="http://www.yourdomain.com/clients/domainchecker.php" method="post">

<input type="hidden" name="token" value="6c1e24a9c785809e2cba609350fda891c9c982ed" />

<input type="hidden" name="direct" value="true">

Domain: <input type="text" name="domain" size="20"> <select name="ext">

<option>.com</option>

<option>.net</option>

<option>.in</option>

</select>

<input type="submit" value="Go">

</form>

Link to comment
Share on other sites

If you want to fully integrate it in your own website, you could try:

<?php
$extenties 	= array("nl","com","co.uk","sc"); // Allowed extensions

if(isset($_GET['domein']) AND preg_match('/[^.]+\.[^.]+$/', $_GET['domein']))
{
$domeinnaam	= urlencode($_GET['domein']);
$domeindeel = explode(".", $domeinnaam, 2);

if(in_array($domeindeel[1], $extenties))
{	
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, "*** URL TO YOUR WHMCS ENVIRONMENT ***/includes/api.php");
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); 
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 100);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, array("username" => "*** WHMCS ADMIN USER ***", "password" => md5("*** WHMCS ADMIN PASS ***"), "action" => "domainwhois", "domain" => $domeinnaam));
	$data = curl_exec($ch);
	curl_close($ch);

	$data = explode(";",$data);

	foreach ($data AS $temp)
	{
		$temp = explode("=",$temp);
		$results[$temp[0]] = @$temp[1];
	}

	if($results['status'] == "available")
		$result = "<b>".$domeinnaam."</b> is free for <a href=\"whmcs/cart.php?a=add&domain=register&sld=".$domeindeel[0]."&tld=.".$domeindeel[1]."\">registration</a>.";
	else
		$result = "<b>".$domeinnaam."</b> is already taken. You can <a href=\"whmcs/cart.php?a=add&domain=transfer&sld=".$domeindeel[0]."&tld=.".$domeindeel[1]."\">transfer</a> it if you're the owner .";
}
else
	$result = "<b>".$domeinnaam."</b> is not available for registration/a transfer.";
}

echo "<form method=\"get\" action=\"".$_SERVER["SCRIPT_NAME"]."\">\n";
echo "	<input type=\"text\" name=\"domein\" /> \n";
echo "	<input type=\"submit\" value=\"Check\" /><br />\n";
echo "	".@$result."\n";
echo "</form>\n";
?>

Don't forget to change the WHMCS API URL, user and password.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated