finger.php configure('javascript URI', '/'); function get_domain($domain) { $pdolist = array('at', 'co.at', 'or.at'); foreach ($pdolist as $pdo) { $d = $domain.'.'.$pdo; $r = finger($d); $text = ( $r == 0 ) ? "occupied" : "free" ; $ret .= sprintf("
%s [%s]", $d, $text); } $objResponse = new xajaxResponse(); $objResponse->assign('domain_label', 'innerHTML', $ret); return $objResponse; } function finger($domain) { $fp = fsockopen('finger.nic.at', 79); $domain .= "\n"; fputs($fp, $domain, strlen($domain)); $text = fgets($fp); fclose($fp); $ret = preg_match ('/NO domain data/', $text) ? 1 : 0; return $ret; } $req_get_domain =& $xajax->registerFunction('get_domain'); $req_get_domain->setParameter(0, XAJAX_INPUT_VALUE, 'domainname'); $xajax->processRequest(); ?> finger printJavascript(); ?> Domain: