<?php
if(!isset($_GET[\'domain\'])) exit;
$domain = str_replace(array(\'www.\',\'http://\'),\'\',trim($_GET[\'domain\']));
if(!$domain||!preg_match(\'/^[a-zA-Z0-9\\-]+\\.[a-zA-Z]{2,4}$/\',$domain)) exit;
// SOAP
$soap = new SOAPClient(\'https://api.http.net/live/1.0/Service.asmx?WSDL\');
$args = array(
\'authentication\' => array(\'username\' => \'*****\', \'password\' => \'******\'),
\'domain\' => $domain,
\'clTRID\' => \'TrackMania2Server.org Whois\'
);
$response = $soap->DomainAvailable($args);
// result
$av = ($response->response->status==\'available\');
echo \'<h4 class=\"\'.($av?\'available\':\'taken\').\'\"><span>\'.($av?\'Available\':\'Taken\').
\"</span> $domain is \".($av?\'Available\':\'Taken\').\'</h4>\';
?>