$id_ndd="";
if (isset($_POST["choix"])){$choix = $_POST["choix"];}else{$choix="";}
if (isset($_POST["domaine"])){$domaine = $_POST["domaine"];}else{$domaine="";}
if (isset($_POST["extension"])){$extension = $_POST["extension"];}else{$extension="";}
if($choix=="Ce nom de domaine"){
$domaine==strtolower($domaine);
$extension==strtolower($extension);
$dom_=$domaine.$extension;
$double=@ereg("--",$domaine);
$is_alpha1 = @ereg("^[0-9A-Za-z-]+$", $domaine);
if((($is_alpha1!=1) || ($double=="1")) && ($domaine!="")){
echo"
Le format du nom de domaine \"".htmlentities($domaine)."$extension\" est incorrect.
Les caractères autorisés sont: \"a-z\" ,\" 0-9\" et \"-\"
";
}
else{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://extranet.marochostdc.com/checkdom.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"domaine=$domaine&extension=$extension&key=Nk18Mn9FzaPlm");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$server_output = curl_exec ($ch);
curl_close ($ch);
// further processing ....
if ($server_output == "OK") { $id_ndd="ok";} else {$id_ndd=""; }
if($id_ndd==""){
?>
error_reporting(0);
set_time_limit(0);
ob_start();
$ext = array(
'.com' => array('whois.crsnic.net','No match for'),
'.net' => array('whois.crsnic.net','No match for'),
'.biz' => array('whois.biz','Not found'),
'.mobi' => array('whois.dotmobiregistry.net', 'NOT FOUND'),
'.org' => array('whois.publicinterestregistry.net', 'NOT FOUND'),
'.tv' => array('whois.nic.tv', 'No match for'),
'.info' => array('whois.afilias.net','NOT FOUND'),
'.name' => array('whois.nic.name','No match'),
'.me' => array('whois.nic.me','NOT FOUND'),
'.co' => array('whois.nic.co','NOT FOUND'),
'.cc' => array('whois.nic.cc','No match'),
'.tel' => array('whois.nic.tel','NOT FOUND'),
'.ws' => array('whois.nic.ws','No match'),
'.ac' => array('whois.nic.ac','NOT FOUND'),
'.pro' => array('whois.registrypro.pro','No match'),
'.ma' => array('whois.iam.net.ma','No Objects Found'),
'.net.ma' => array('whois.iam.net.ma','No Objects Found'),
'.co.ma' => array('whois.iam.net.ma','No Objects Found'),
'.press.ma' => array('whois.iam.net.ma','No Objects Found'),
'.gov.ma' => array('whois.iam.net.ma','No Objects Found'),
'.ac.ma' => array('whois.iam.net.ma','No Objects Found'),
);
if($domaine=="casino"){$domaine="";}
if($domaine=="episte"){$domaine="";}
if($domaine!=""){
$domaine_script=$domaine.$extension;
unset($buffer);
preg_match('@^(http://www\.|http://|www\.)?([^/]+)@i', $domaine_script, $matches);
$domaine_script = $matches[2];
$tld = explode('.', $domaine_script, 2);
$extension_ = strtolower(trim($tld[1]));
if(strlen($domaine_script) > 0 && array_key_exists('.' . $extension_, $ext)) {
$server = $ext['.' .$extension_][0];
$sock = fsockopen($server, 43) or die('Error Connecting To Server:' . $server);
fputs($sock, "$domaine_script\r\n");
while( !feof($sock) ) { $buffer .= fgets($sock,128); }
fclose($sock);
//if($extension == 'org') echo nl2br($buffer);
if(eregi($ext['.' . $extension_][1], $buffer)) {
?>
Le nom de domaine : echo htmlentities($domaine).htmlentities($extension) ?> que vous souhaitez renouveller n'est pas enregistré.
}
else {
?>
Le nom de domaine : echo htmlentities($domaine).htmlentities($extension) ?> que vous souhaitez renouveller n'est pas géré par Maroc HOST.
}
}
}
ob_flush();
flush();
sleep(0.1);
}
else{
?>
Votre demande de renouvellement de : echo htmlentities($domaine).htmlentities($extension) ?> a été bien prise en compte.
Notre Centre de Relation Client vous contactera dès que possible.
$message1="
Bonjour,
Nous avons reçu une demnade de renouvellement du nom de domaine $domaine$extension
";
$sujet="Demande de renouvellement";
$headers= "MIME-version: 1.0\n";
$headers.= "Content-type: text/html; charset=utf-8\n";
$headers.='From: "Centre de Relation Client de Maroc HOST "
'."\n";
$email_us="service.clientele@marochost.com";
$envoi_mail = mail($email_us,$sujet,$message1,$headers);
?>
}
}
}
if($choix==""){
?>
Vous pouvez renouveler un nom de domaine à tout moment. Pour cela, indiquez directement votre(vos) domaine(s) sur le formulaire ci-dessous ou sur l’interface de commande de notre site.
Le renouvellement sera comptabilisé à compter de la validation de votre paiement. Notez que le renouvellement ne modifie pas la date anniversaire de votre nom de domaine, vous ne perdez donc rien en renouvelant vos domaines avant leur expiration, et vous évitez ainsi des désagréments suite à un oubli.
}
?>