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.

advertisement

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest updates, web design resources and tools.

You have Successfully Subscribed!

About The Author

  • ADD YOUR COMMENT

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Receive fresh web design resources and SEO tips in your email by our weekly newsletter

You have Successfully Subscribed!