Username availability checking using Ajax

Must Read : Username availability checking using Ajax

Step 1: Creating database table for username availability checking and insert some data
CREATE TABLE IF NOT EXISTS user_information (
id int(11) NOT NULL AUTO_INCREMENT,
username varchar(255) NOT NULL,
email varchar(255) NOT NULL,
password varchar(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY email (email)
)

INSERT INTO user_information (id, username, email, password) VALUES
(1, ‘admin’, ‘admin@admin.com’, ‘12345’),
(2, ‘admin123’, ‘admin123@admin.com’, ‘12345’),
(3, ‘wearecoders’, ‘info@wearecoders.net’, ‘12345’);

Step2: Now we Creating our view file index.php. This file will show a html form.

Step 3: Create style.css for styling our view file

Step 4: Now create usernamevalid.js file. This file will take value from the form and using ajax we show the availability message to the user.

Step 5: Create the connection file conn.php to create php with mysql

Step 6: Create user_valid.php for username availability checking. This file receive the ajax post request for username and check if the username already exist or not

Step 6: Create email_valid.php for email address availability checking. This file receive the ajax post request for email address and check if the emailalready exist or not

(Visited 31 times, 1 visits today)

Leave a Comment.