我有一个放在容器中的域名检查表。在我提交表单后,会检查域名的可用性,并在与表单相同的容器中显示一条消息。显示消息时,我希望表单和第一个 H2 消失。我怎样才能做到这一点?
我的代码:
<div id="domain-name-check">
<h2>Is uw domeinnaam nog vrij?</h2>
<form method='post' class="clearfix">
<input type=text name=domain>
<select name="suffix">
<option value=".nl">.nl</option>
<option value=".be">.be</option>
<option value=".com">.com</option>
<option value=".net">.net</option>
<option value=".org">.org</option>
<option value=".biz">.biz</option>
<option value=".info">.info</option>
<option value=".mobi">.mobi</option>
<option value=".ws">.ws</option>
<option value=".cc">.cc</option>
</select>
<input type=submit name=proses value=Check>
</form>
<?php
if(isset($_POST['proses'])){
$domain_name = "$_POST[domain]"."$_POST[suffix]";
$arrHost = @gethostbynamel("$domain_name");
$date = date('y-m-d');
if(empty($arrHost)){
echo "<h2>$domain_name is beschikbaar</h2> <a href='/offerte-aanvragen/".$domain_name."/'>Vraag een offerte aan</a>";
$availability = "yes";
}else{
echo "<h2>$domain_name is helaas bezet</h2> <a href='/offerte-aanvragen/".$domain_name."/verhuizen/'>Verhuis uw domein</a>";
$availability = "no";
}
mysql_query("INSERT domainnames SET dns='".$domain_name."', available='".$availability."', timestamp='".$date."'")or die(mysql_error());
}
?>
</div>