Location: PHPKode > scripts > CJ Domain Whois > cj domain whois/whois.php
<?
if($_GET['action'] == "view")
{
	session_start();
	include("config.php");
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Whois Details</title>
<?
if($language == "arabic")
{
?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
<meta http-equiv="Content-Language" content="ar-sa" />
<?
}
else
{
?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />	
<?
}
?>
<link rel="stylesheet" type="text/css" media="screen, projection" href="<? print $whoisUrl; ?>/css/<? print $stylesheet; ?>">
</head>
<body>
<?	
}
	$results = array();
	
	if($_GET['action'] == "view")
	{
		print "<h1>".getLabel("whois_details_title")."</h1>";
		
		if($_SESSION && ($_SESSION['preventspam'] == md5($whoisUrl)))
		{		
			$tldOK = checkTLD($_POST['tld']);
			
			if($GLOBAL_DOMAIN && $tldOK)
			{
				if($fetch = getWhoisRecords($_POST['tld'], $GLOBAL_DOMAIN))
					$record = $fetch;
				else
					$record = "no";	
			}
			
			if($record)
			{
				print "<h2>".getLabel("whois_records_below", $GLOBAL_DOMAIN, $_POST['tld'])."</h2>";
				print "<pre id=\"whoisdetails\">\n";
				if($record == "no")
					print getLabel("no_whois_record", $GLOBAL_DOMAIN, $_POST['tld']);
				else if($record == "adown")
					print getLabel("whois_server_down", $GLOBAL_DOMAIN, $_POST['tld']);
				else
					print trim($fetch);
				print "</pre>";
			}
		}
		print "<br />";
		print "<div style='text-align:center'>";
		print "<input type='button' value='".getLabel("close_window")."' onclick='window.close();' />";
		print "<p style='font-size:11px'>Powered by <a href='http://www.cj-design.com/products/free_downloads/php_scripts/cjdomainwhois/' title='domain name availability'>CJ Domain Whois V1.0</a><br />&copy; <a href='http://www.cj-design.com' title='web design uk'>CJ Website Design</a> ".date("Y")."</p>";
		print "</div>";
		print "</body>";
		print "</html>";
	}
	else
	{
		if($_POST['domain'])
		{
			// if user types in TLD into domain form, overwrite TLD here
			
			$tldOK = checkTLD($_POST['tld']);
			$tldc = $_POST['tld'];
			
			if($tldc == "all")
			{
				$tldslist = array_keys($domainInfo);
				$tldc = $tldslist[0];
			}
			if(!$_COOKIE['cjwhois_searches'])
				$_COOKIE['cjwhois_searches'] = $_SESSION['cjwhois_searches'];
			if($maximumSearches && (($_COOKIE['cjwhois_searches']+1) >= $maximumSearches) && !isset($_SESSION['whois'][$GLOBAL_DOMAIN][$tldc]))
			{
				print "<p>".getLabel("maximum_searches_reached")."</p>";
				closeWhoisProgress();
			}
			else
			{
				if($GLOBAL_DOMAIN && $tldOK)
				{
					if ($_POST['tld'] == "all")
					{
						//$domainInfoFlipped = array_reverse($domainInfo, true);
						foreach($domainInfo as $tld => $attribs)
						{
							$fetch = getWhoisRecords($tld, $GLOBAL_DOMAIN, true);
							
							if($fetch == "adown")
								$results[$tld] = "adown";
							else
							{
								if($fetch)
									$results[$tld] = $fetch;
								else
									$results[$tld] = "available";
							}
							
						}
							
					}
					else
					{
						if($_POST['tld'])
						{
							
							$fetch = getWhoisRecords($_POST['tld'], $GLOBAL_DOMAIN, true);
							
							if($fetch == "adown")
								$results[$tld] = "adown";
							else
							{
								if($fetch)
									$results[$_POST['tld']] = $fetch;
								else
									$results[$_POST['tld']] = "available";
							}
						}	
					}
				}
				else
				{
					if(!$tldOK)
						print "<p>".getLabel("tld_not_supported")."</p>";
					else
						print "<p>".getLabel("domain_name_invalid")."</p>";
					closeWhoisProgress();
				}
			}
			
			if($results)
			{
				$resultsflipped = array_reverse($results, true); // flip results that come in backwards
				closeWhoisProgress();
				displayResultsTable($resultsflipped);
				print "<br /><br />";
				print "<div id='checkanotherform'>";
				renderForm(getLabel("check_another_label"));
				print "</div>";
			}
		}
		print "<p style='font-size:11px;text-align:center'>Powered by <a href='http://www.cj-design.com/products/free_downloads/php_scripts/cjdomainwhois/' title='domain name availability'>CJ Domain Whois V1.0</a><br />&copy; <a href='http://www.cj-design.com' title='web design uk'>CJ Website Design</a> ".date("Y")."</p>";
	}

?>
Return current item: CJ Domain Whois