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.
You May Like This
Build a Simple Quiz In PHP | Source Code
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.
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.
Thanks For Visiting, Keep Visiting.
hi its submit very cool
thanks buddy
hi how do i contact you ? sent a message from you contact page do reply thanks for this site gr8 effort
91371 489307This will be a terrific blog, would you be interested in doing an interview about just how you developed it? If so e-mail me! 749986
Bro this is a WordPress based blog.
Please post a php code for search filter by using php(Search bar)
like I want to search for job portal : in table form
search by jobtype and city from database
without ajax and js
I am still learning html, how do I run the two files above so they work? Thank you for your attention
for running PHP you should install xampp server on your computer
Hello, the $godaddycheck doesn’t used anywhere. Why is that line there?
Hi there, can you add an ajax script so it will show the search result without reloading the page? Im searching everywhere how to do it and cant figure it out.
Thanku for information
Thanks a lot, awesome
I edit it and make it more cool.
https://ibb.co/k5jgRNv
Great!!
can you please give me this ?
Sir, Please Make the Whois PHP Program.
ok
As I can see, actually it doesn’t use godaddy nor name nor register… Ô_o
Why did you put it there?
Hi Shaan, Great thanks for sharing ultimate post. I really like it. I just wanted to know that… Is there a way to Domain Availability Check in a single page on wordpress, blogger or any platform. like a enbed code or anything. Is show only a form to check domain availability.
Hey, this doesn’t work.
This gethostbyname() is only to check if its assigned to a hosting.
This amazing, simple to understand and well-detailed tutorial.
It’s very helpful code I found here. Thanks bro keep it up!
Such a nice and simple tool.Thanks.
It only uses gethostbyname and doesn’t check if DNS records exist or if it’s already registered.