Domain Availability Checker In PHP | Get Source Code

Get Source Code

Domain Availability Checker In PHP | Get Source Code
Domain Availability Checker In PHP

Domain Availability Checker In PHP: When we create a new website, we first get its domain name. Because taking the domain name is the most needed thing in website creation. And nowadays, the get domain name you want is very difficult, because someone has already registered. For that, we check the domain name in any domain registry website, that no one has already registered this name.

All domain name registration sites before registration of the name, firstly check the availability of name selected by the customer. Today we will learn to make Domain Availability Checker In PHP. You heard right, using a very easy method, we can create this program in PHP. With the help of this article, you can create a basic domain availability checker in PHP. I agree that this is very basic but it is quite right to learn.

Simple Domain Availability Checker In PHP Source Code:

This program is created with the help of some well-known domain registration sites like Godaddy, mane.com, and register.com. Basically, I had created a form with HTML, CSS & Bootstrap. In the form section, I added <input type=”text”> and submit button. I put a name called “domain” in <input> section. It is not necessary that you give this name, you can give it anything you want. After that, I had created a PHP program for domain name availability searching. Basically, this program searches domain name availability from other sites & put result here. If domain already registered here will so already taken. Otherwise, show this name is available. Now let’s move to the source code of this program.

Source Code

There are two files first “domain-check.php” the second one is “style.css“.

First, create a file named “domain-check.php” and paste these codes.

 

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

<!doctype html>

<!-- Code by Webdevtrick (https://webdevtrick.com) -->

<html>

<head><title>Search Availability of Domain...</title>

 

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<link rel="stylesheet" href="style.css">

</head>

 

<body>

 

<div class="container">

<div class="row">

        <div class="col-md-6">

     <h3>Check Domain Name Availability</h3>

<form action="" method="GET">

            <div id="custom-search-input">

                <div class="input-group col-md-24" >

                    <input type="text" name="domain" class="form-control input-lg" placeholder="Example.com or Example.in etc." />

<span class="input-group-btn">

                        <button type="submit" class="glyphicon glyphicon-search"></button>

                            

                        

                    </span>

                </div>

            </div>

</form>

<?php

error_reporting(0);

if(isset($_GET['domain'])){

$domain = $_GET['domain'];

$godaddycheck = 'https://in.godaddy.com/domains/searchresults.aspx?checkAvail=1&tmskey=&domainToCheck='.$domain.'';

$namecomcheck = 'https://www.name.com/domain/search/'.$domain.'';

$registercomcheck = 'http://www.register.com/domain/search/wizard.rcmx?searchDomainName='.$domain.'&searchPath=Default&searchTlds=';

if ( gethostbyname($domain) != $domain ) {

  echo "<h1>Already Registered!</h1>";

}

else {

  echo "<h3>$domain</h3><h2><br>Not Taken, you can register it.

  </h2>";

}

}

?>

        </div>

</div>

</div>

 

</body>

 

</html>

After that, Create a CSS file named “style.css” for little bit styling & paste these codes.

CSS

 

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

/** code by webdevtrick (https://webdevtrick.com) **/

.container{

  width: 80%;

  position: absolute;

  top: 30%;

  left: 30%;

  

}

#custom-search-input{

    padding: 3px;

    border: solid 1px #E4E4E4;

    border-radius: 6px;

    background-color: #fff;

display: inline-block;

}

#custom-search-input input{

    border: 0;

    box-shadow: none;

}

#custom-search-input button{

    margin: 2px 0 0 0;

    background: none;

    box-shadow: none;

    border: 0;

    color: #666666;

    padding: 0 8px 0 10px;

    border-left: solid 1px #ccc;

}

#custom-search-input button:hover{

    border: 0;

    box-shadow: none;

    border-left: solid 1px #ccc;

}

#custom-search-input .glyphicon-search{

    font-size: 23px;

}

h1{

color:red;

}

h2{

color:green;

}

Now you’ve successfully created a domain availability checker. I hope you guys like this post or article. If you have any query or question comment down below.