PHP jQuery AJAX Live check email Availability

PHP jQuery AJAX Live check email Availability

Today, We want to share with you PHP jQuery AJAX Live check email Availability.
In this post we will show you Live check email Availability Check using PHP and jQuery AJAX, hear for Email live availability check using jquery and Ajax in PHP we will give you demo and example for implement.
In this post, we will learn about Live Username Availability Check using PHP and jQuery AJAX with an example.

Live check domainname-username-email checker for registration search domain name cehck has become useful part of live check registration or availability or not system.
This PHP script therefor able to also be used for any other purpose, such as checking domain name, email address or other any things
just we will see a simple javascript with PHP script to implement domain name or username live checking feature using AJAX technologies, jQuery technologies and MySQL database.
This is a most common and best popular feature available in the most of the websites or blogs available online.

Read Also:  laravel flash message Notification in Blade template

Checking domain name and UserName and Email Address of the user on add form or SignUp form is good way to prevent duplicate content on mysql-database and several all other many problems solution.

create a database -mysql

first of all create Database Name : domain_hostexamples
second thing run this script in sql : user.sql

[code]
CREATE TABLE IF NOT EXISTS `domain_mst` (
`domainId` int(8) NOT NULL AUTO_INCREMENT,
`domainName` varchar(55) NOT NULL,
`password` varchar(55) NOT NULL,
`d_firstName` varchar(55) NOT NULL,
`d_lastName` varchar(55) NOT NULL,
PRIMARY KEY (`domainId`)
)

Read Also:  country state city drop down list using JavaScript

INSERT INTO `domain_mst` (`domainId`, `domainName`, `password`, `d_firstName`, `d_lastName`) VALUES
(24, ‘gtu’, ”, ‘gtu’, ‘com’),
(26, ‘w3free’, ”, ‘w3free’, ‘com’),
(27, ‘w3schools’, ”, ‘w3schools’, ‘com’),
(28, ‘pakainfo’, ”, ‘pakainfo’, ‘com’);

[/code]

File Name : index.php

<style>
body{width:50%;}
#frmCheckdomainName {border-top:#F0F0F0 2px solid;background:#FAF8F8;padding:10px;}
.ex_demoInputBox_data{padding:7px; border:#F0F0F0 1px solid; border-radius:4px;}
.data_status_available_ch{color:#2FC332;}
.data_status_not_available_ch{color:#D60202;}
</style>
<script src="yourdirname/jquery-2.1.1.min.js" type="text/javascript"></script>
<script>
function do_checkAvailability() {
	$("#img_loaderIcon").show();//jquery-2 call
	jQuery.ajax({
	url: "do_check_availability_page.php",
	data:'domainName='+$("#domainName").val(),
	type: "POST",
	success:function(data){
		$("#user-availability-status").html(data);
		$("#img_loaderIcon").hide();
	},//generate error
	error:function (){}
	});
}
</script>

<div id="frmCheckdomainName">
  <label>Check Domain Name:</label>
  <input name="domainName" type="text" id="domainName" class="ex_demoInputBox_data" onBlur="do_checkAvailability()"><span id="user-availability-status"></span>    
</div>
<p><img src="img_loaderIcon.gif" id="img_loaderIcon" style="display:none" /></p>

File Name : do_check_availability_page.php

require_once("dbcontroller.php"); //include custome file
$db_handle = new DBController(); //object created

//check condition using php

if(!empty($_POST["domainName"])) {
  $query_result = mysql_query("SELECT count(*) FROM domain_mst WHERE domainName='" . $_POST["domainName"] . "'");
  $fetch_row = mysql_fetch_row($query_result);
  $total_user_count = $fetch_row[0];
  if($total_user_count>0) {
      echo "<span class='data_status_not_available_ch'> Domain Name Not Available.</span>";
  }else{
      echo "<span class='data_status_available_ch'> Domain Name Available.</span>";
  }
}


Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  How To use Bootstrap Timepickar Example Code ?
  2. Read Also:  Vue.js onclick Event Handling Example
  3. Read Also:  How to get Main or Base URL in Laravel?
  4. Read Also:  how to delete data from database in php using button?
  5. Read Also:  CheckBox ng-change Events using Angular Example
  6. Read Also:  jQuery CDN Link Cheat Sheet Download
  7. Read Also:  PHP Laravel Add Days Hours Minutes To Datetime
  8. Read Also:  Laravel Global Variables Example Tutorial From Scratch
  9. Read Also:  country state city drop down list using JavaScript
  10. Read Also:  jQuery CDN Link Cheat Sheet Download
CLOSEX