How to submit a registration form in Codeigniter using JQuery AJAX | Registration | Login

Hello viewers, In this article we are going to see login Codeigniter registration form using Ajax code.

In this article, I am going to provide complete the login and registration process including forget & reset the password.

This article consists of : 

  • Registration
  • OTP verification
  • Login
  • Profile
  • Forget password
  • Reset Password

Demo           Download  

Here I am going to explain a brief summary on how to create registration form in codeigniter with codeigniter ajax login example and run it on your localhost, as showing steps consists of different modules.

You can see the demo and download the source code which consists of all modules mentioned above.

Steps to run code on your server : 

  • Create a folder with the name userSignIn-Up in your htdocs folder.
  • Download the code and add the zip inside userSignIn-Up folder and extract it there.
  • Copy all the files inside signinupjquery-master folder and paste it inside userSignIn-Up folder.
  • Open your phpmyadmin and create a database with the name user_signin_up_db and import user_signin_up_db.sql which I provided it, you can see it in your root folder where application, assets folders are present.
  • if you don’t know how to import database just run the below code in your phpmyadmin placing in SQL.
CREATE TABLE `vb_users` (
 `id` bigint(20) NOT NULL AUTO_INCREMENT,
 `user_id` bigint(20) DEFAULT NULL,
 `full_name` varchar(64) DEFAULT '',
 `user_email` varchar(64) DEFAULT '',
 `mobile_number` varchar(16) DEFAULT '',
 `user_phone_otp` varchar(8) DEFAULT '',
 `user_phone_verify` enum('N','Y') DEFAULT 'Y',
 `password` varchar(512) DEFAULT '',
 `user_password_otp` varchar(8) DEFAULT '',
 `creation_ip` varchar(16) DEFAULT '',
 `creation_date` datetime DEFAULT '1970-01-01 00:00:00',
 `creation_lat` varchar(32) DEFAULT '',
 `creation_long` varchar(32) DEFAULT '',
 `created_by` bigint(20) DEFAULT NULL,
 `update_ip` varchar(16) DEFAULT '',
 `update_date` datetime DEFAULT '1970-01-01 00:00:00',
 `update_lat` varchar(32) DEFAULT '',
 `update_long` varchar(32) DEFAULT '',
 `updated_by` bigint(20) DEFAULT NULL,
 `status` enum('A','I','B','D') DEFAULT 'A',
 PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4

  • Now Open your browser and type http://localhost/userSignIn-Up/ and enter.
  • your code is ready and you can check by submitting the form.

Note: if you want to change the folder name or database name, you need to make changes in the config.php file, database.php file & change the database name according to your requirements.

Make sure that your database name in the database.php file and in PHPMyAdmin is the same.

File Paths : 

  • Login
    • Controller = application/controllers/user/login
    • model = application/models/common_model
    • views = application/views/user/login
  • Signup
    • Controller = application/controllers/user/signUp
    • model = application/models/common_model
    • views = application/views/user/signup
  • otpverification
    • Controller = application/controllers/user/otpverification
    • model = application/models/common_model
    • views = application/views/user/otpverification
  • forgetpassword
    • Controller = application/controllers/user/forgetPassword
    • model = application/models/common_model
    • views = application/views/user/forgetpassword
  • resetpassword
    • Controller = application/controllers/user/resetPassword
    • model = application/models/common_model
    • views = application/views/user/resetpassword
  • profile
    • Controller = application/controllers/user/myProfile
    • model = application/models/common_model
    • views = application/views/user/profile
  • URL’s from ajax are first sent to routes.php(application/config/routes.php) and then to controller.
  • To use ajax functionality with validation you need to have jquery CDN & jquery.validate file or CDN.

This is the whole process to submit a form, for any doubts or clarification you can comment on your queries and upload your issues in the comment box below.

Suggested Articles

Install MongoDB and connect it with PHP

How to use MongoDB in CodeIgniter with example

Convert MySQL queries to CodeIgniter

Thank you for reaching here, Do follow us on our Facebook & Instagram page for more updates.

Leave a Reply

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

The maximum upload file size: 2 MB. You can upload: image, document. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded.