I am trying to check only selected domain extensions using check-box but it check all domain extensions existing in array.
here is what I am trying.
$name_domain = trim($_POST['domain_name']).$_POST['suffix'];
$domains = array(
($name_domain) ? trim($_POST['domain_name']).$_POST['suffix'] : '',
(isset($_POST['_org'])) ? trim($_POST['domain_name']).'.org' : trim($_POST['domain_name']).$_POST['_org'],
(isset($_POST['_net'])) ? trim($_POST['domain_name']).'.net' : trim($_POST['domain_name']).$_POST['_net'],
(isset($_POST['_biz'])) ? trim($_POST['domain_name']).'.biz' : trim($_POST['domain_name']).$_POST['_biz'],
(isset($_POST['_ws'])) ? trim($_POST['domain_name']).'.ws' : trim($_POST['domain_name']).$_POST['_ws'],
(isset($_POST['_mobi'])) ? trim($_POST['domain_name']).'.mobi' : trim($_POST['domain_name']).$_POST['_mobi'],
(isset($_POST['_info'])) ? trim($_POST['domain_name']).'.info' : trim($_POST['domain_name']).$_POST['_info'],
);
$msg='';
foreach($domains as $d){
$response = @dns_get_record($d, DNS_ALL);
if(empty($response)){
$msg .= "<h2 style='color:green;' >Domain $d is available.</h2>";
}else if(!empty($response)){
$msg .= "<h2 style='color:red;'>Domain $d has taken.</h2>";
}
html
<td colspan="2"><input type="checkbox" name="_org" value=".org"> <label for="_org">.org</label></td>
<td colspan="2"><input type="checkbox" name="_net" value=".net"> <label for="_net">.net</label></td>
<td colspan="2"><input type="checkbox" name="_biz" value=".biz"> <label for="_biz">.biz</label></td>
<td colspan="2"><input type="checkbox" name="_ws" value=".ws"> <label for="_ws">.ws</label></td>
<td colspan="2"><input type="checkbox" name="_mobi" value=".mobi"> <label for="_mobi">.mobi</label></td>
<td colspan="2"><input type="checkbox" name="_info" value=".info"> <label for="_info">.info</label></td>
any idea how to only show and check only selected extension checking through checkboxes?