-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkdomain.php
91 lines (90 loc) · 3.02 KB
/
checkdomain.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
<title> Check Domain Availability</title>
</head>
<body>
<div class="wrapper">
<h2>Check Domain Name Availability</h2>
<div class="container">
<form action="" method="GET">
<input id="searchBar" class="searchbar" type="text" name="domain" placeholder="Search domain name..." value="<?php if(isset($_GET['domain'])){ echo $_GET['domain']; } ?>">
<button type="submit" id="btnSearch" class="btn-search"><i class="fa fa-search"></i></button>
</form>
</div>
<?php
error_reporting(0);
if(isset($_GET['domain'])){
$domain = $_GET['domain'];
if ( gethostbyname($domain) != $domain ) {
echo "<h3 class='fail'>Domain Already Registered!</h3>";
}
else {
echo "<h3 class='success'>Hurry, your domain is available!, you can register it.</h3>";
}
}
?>
</div>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"/>
<style type="text/css">
body, h2, h3 {
font-weight: normal;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #333;
}
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 90vh;
}
h2 {
font-size: 26px;
text-align: center;
}
h3 {font-size: 24px; }
h3.success {
color: #008000;
text-align: center;
}
h3.fail {
color: #ff0000;
text-align: center;
}
.container {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.searchbar {
padding: 6px 10px;
width: 400px;
max-width: 100%;
border: none;
margin-top: 1px;
margin-right: 8px;
font-size: 1em;
border-bottom: #333 solid 2px;
transition: 0.3s;
}
.searchbar::placeholder {
font-size: 1em;
}
.searchbar:focus {
outline: none;
}
.btn-search {
cursor: pointer;
text-decoration: none !important;
font-size: 1.5em;
padding-top: 5px;
padding-bottom: 5px;
background-color: transparent;
border: none;
outline: none;
}
</style>
</body>
</html>