in , , ,

Check Username Availability Using PHP And Jquery


In a registration form there is a need to check the available user name. Using ajax request to check available username is a good idea. It is required and reduce users’ effort while registering for a new account. You have seen this kind of arrangement in Gmail sign up form for validation of available email address.

For this, you need to check whether the username exists or not dynamically. You can do it with the help of jQuery and PHP. First of all create an HTML form. Then use jQuery to call a PHP file. This Php file will check the available usernames in database.

See the code of all files below.

JQuery Code


CSS code

Php code:

HTML code:

Integrate these codes.

In php code, I have used array for used username. for a real time application you will have to fetch used username from database. If you have any kind of problem in implementing that, you can ask via comments.


Written by Deepanker

Deepanker Verma is the founder of Techlomedia. He is a tech blogger, developer and gadget freak.

Leave a Reply

Your email address will not be published. Required fields are marked *


Validate Email Address With Regular Expression in PHP

Google Panda

How to optimize website for Google Panda