-
Notifications
You must be signed in to change notification settings - Fork 0
/
domain.php
55 lines (50 loc) · 1.35 KB
/
domain.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form action="" method="post">
<table>
<tr>
<td>Enter Domain Name</td>
<td><input type="text" name="domain_name"></td>
<td>
<select name="suffix" id="">
<option value=".com">.com</option>
<option value=".ir">.ir</option>
<option value=".in">.in</option>
<option value=".co.in">.co</option>
<option value=".net">.net</option>
<option value=".org">.org</option>
<option value=".biz">.biz</option>
<option value=".info">.info</option>
<option value=".tv">.tv</option>
<option value=".ca">.tv</option>
</select>
</td>
<tr align="right" colspan="3">
<td><input type="submit" name="check" value="Check"></td>
</tr>
</tr>
</table>
</form>
<?php
if(isset($_POST['check'])){
if (!empty($_POST['domain_name'])) {
$name_domain=trim($_POST['domain_name']).$_POST['suffix'];
$response=@dns_get_record($name_domain,DNS_ALL);
if (empty($response)) {
echo "<h2 style='color:green;' >Domain ".$name_domain." is available.</h2>";
}else{
echo "<h2 style='color:red;' >Domain ".$name_domain." is taken.</h2>";
}
}else{
echo "<h2 style='color:red;' >Error Domain name can not be left empty.</h2>";
}
}
?>
</body>
</html>
?>