How to Create a Registration Form in CodeIgniter

Create a Registration Form in CodeIgniterAs of now, CodeIgniter is a best development framework for PHP developers. This is not a CMS like WordPress, Opencart where by you should create top to bottom yourself, even if you need contact form. Only need is you should already know about CodeIgniter MVC pattern. But it is has several own helper files, you might also create it. This helpers files are PHP files that has a collection of functions, already written by CodeIgniter developer to help you with tasks. So we can use form helper files to create a registration form.

Create A Registration Form

I expect you gone through the installation and configuration database connectivity, If you’re a novice user download latest version CI from official website. Enter your database credentials in /application/config/database.php file once completed open /application/config/config.php and set $config[‘base_url’] If didn’t enter manually CodeIgniter will try to find out your baseurl if cannot able find CI will automatically add any url as your base sometimes it may wrong.

Creating controller file

Create an empty .php document underneath  /application/controllers copy & paste all that snippets. This is your controller file make that Controller name and class must be same.

Creating Database for store user input

make a file inside /application/models and name it as System_model.php and add the following code into it. This is your models file it can able to interact with database.

Creating home page

As you guess it is your home page, i created this for just showing all the values entered  when creating a new registration. It simply fetching and displays files from database.

 Creating registration page

This entry portal allows user to enter corresponding details, on form submit it send all data into database.

Now you can create a complete registration form quite easily. If you face any bugs feel free to ask me.

Leave a Reply

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