Configuration Setting

Similar documents
Astervander Technical Document

I completely understand your anxiety when starting learn codeigniter.

The connection has timed out

NETCONF Client GUI. Client Application Files APPENDIX

Introduction to PHP. Handling Html Form With Php. Decisions and loop. Function. String. Array

Presentation and Installation

Codeigniter interview questions and answers

Host at 2freehosting.Com

Installing Joomla

Helpline No WhatsApp No.:

Including Dynamic Images in Your Report

How to integrate the calendar in

Get in Touch Module 1 - Core PHP XHTML

WeChat Adobe Campaign Integration - User Guide

PHP: Software Training Employability Programme

Building Block Installation - Admins

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

DDR & jquery More than just hover & dropdown

Learn Web Development CodersTrust Polska course outline. Hello CodersTrust! Unit 1. HTML Structuring the Web Prerequisites Learning pathway.

Tivoli Common Reporting V Cognos report in a Tivoli Integrated Portal dashboard

Jquery Ajax Json Php Mysql Data Entry Example

Installing Oracle Database 11g on Windows

Installing PHP on Windows 10 Bash and Starting a Local Server

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL.

Welcome to the SIGGRAPH online networking tool!

Static Webpage Development

Joomla 1.6 Integration

How to Create a NetBeans PHP Project

Getting started with Raspberry Pi (and WebIoPi framework)

Venafi DevOps Integrations

Introduction Introduction Architecture Overview LAMP Server Limesurvey Custom Made Development... 3

Assignment #3 CSCI 201 Spring % of course grade Title Weathermeister Back-End API Integration

PHP WITH ANGULAR CURRICULUM. What you will Be Able to Achieve During This Course

ForgeRock Access Management Customization and APIs

UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL 2016 EXAMINATIONS. CSC309H1 S Programming on the Web Instructor: Ahmed Shah Mashiyat

Advanced PHP and MySQL

Configuring WordPress for Multiple Environments

MSEDCL e-tendering Contractor Registration Guide

MyClinic. Password Reset Guide

EPHP a tool for learning the basics of PHP development. Nick Whitelegg School of Media Arts and Technology Southampton Solent University

Using PHP with MYSQL

Managing Databases. Prerequisites. Information About the Database Administration Tools CHAPTER

Contains Errors Codeigniter

Case Study Schedule. NoSQL/NewSQL Database Distributed File System Peer-to-peer (P2P) computing Cloud computing Big Data Internet of Thing

Tutorials Php Y Jquery Mysql Database Without Refreshing Code

SO, ARE YOU READY? HERE WE GO:

Andowson Chang

Create-A-Page Design Documentation

System Guide

Simple SCORM LMS Adapter Full Documentation

Reading Writing Speaking Reading Writing Speaking. English Intermediate Intermediate Elementary Intermediate Intermediate Elementary

Documentation of Woocommerce Login / Sign up Premium. Installation of Woocommerce Login / Sign up Premium

Mobile Login extension User Manual

Pupilpod Mobile Application. User Guide

ClickToCall SkypeTest Documentation

IBM C IBM WebSphere Portal 8.0 Solution Development. Download Full version :

PHP. MIT 6.470, IAP 2010 Yafim Landa

Salvatore Rinzivillo VISUAL ANALYTICS

Enable jquery Mobile on WebSphere Portal

Xeretec Scan to OneDrive Secure and Convenient

CS193X: Web Programming Fundamentals

JavaScript for WordPress. Zac

SharpSchool Chapter 7 USER MANUAL EXTERNAL LINK PAGE For more information, please visit:

this is a cat CS50 Quiz 1 Review

Software Keycode Installation Guide

Grading Rubric Homework 1

SQL Server Deployment Installation Manual. Call a Hygiena representative for more information or support

Adrien Poupa TP040869

Manual Html Image Src Url Path Not Working

Frontend UI Training. Whats App :

aibrowser Edition

Technical support work regulations time zone UTC +02:00 working hours 10:00 to 20:00 Support may not be on Saturday and Sunday

Psydro Extension Documentation V.2.x

Tyler Identity User Account Management New World ERP Foundation

Simple AngularJS thanks to Best Practices

MySQL: Access Via PHP

CS Homework 12

Web based testing: Chucklist and Selenium

Creating the Data Layer

SAHARA BIKE1 RESPONSIVE MAGENTO THEME

Yii User Identity Error Code 100

Introduction Installing DNN The ControlBar Host Pages Site Administration Tools Configuring Project Modules...

Integrity attacks (from data to code): Malicious File upload, code execution, SQL Injection

Password Managers: Attacks and Defenses

How to Login, Logout and Manage Password (QRG)

Quick Start Manual for Mechanical TA

An Introduction to JavaScript & Bootstrap Basic concept used in responsive website development Form Validation Creating templates

Phase I. Initialization. Research. Code Review. Troubleshooting. Login.aspx. M3THOD, LLC Project Documentation

SciFinder On-Campus User Registration

Compiere 3.3 Installation Instructions Linux System - Oracle Database

Ampliación de Bases de Datos

Security and Privacy. SWE 432, Fall 2016 Design and Implementation of Software for the Web

Install WordPress 3.X In Multi Blog / Multi user mode On localhost

How To Build A Free Website

Web Security. Jace Baker, Nick Ramos, Hugo Espiritu, Andrew Le

ipad App Published on Panopto Support (

KonaKart Shopping Widgets. 3rd January DS Data Systems (UK) Ltd., 9 Little Meadow Loughton, Milton Keynes Bucks MK5 8EH UK

Partner Integration Portal (PIP) Installation Guide

CV. Techno Media Pratama. Hari Pratomo [COURIER MANAGEMENT SYSTEM]

TABLE OF CONTENT. Overview Support Versions Getting Started Guide Install by Copying Files Configuration...

Transcription:

Hello friends, this is my first blog on Codeigniter framework. In this, we are going to make login, signup and user listing system. Firstly, install the Codeigniter framework either in your local server means localhost or in any live server. Also, below are the topics which we will discuss in this section. 1. 2. 3. Signup System Login System User Listing ( Display the registered users) Configuration Setting Before start coding, we need to set some configuration settings in our application/config folder open config.php file and do some configuration as shown below. Set base URL Set index page Database setting Here, we are going to make the connection between our Codeigniter application and Mysqli. In application/config folder open database.php file and also, place the below code in that file.

In above code Hostname is localhost, database name is test and username is root. Config (autoload.php) In this file, we need to load all the libraries and helpers we want. The file path is application/config/autoload.php. Also, below is the example of loading libraries and helpers.

Create Users Table Before, doing coding first create users table in your database. Also, below is the code for creating table. Signup System In signup system first, we need to make a form containing fields like Name, Username, Email and Password. For that purpose, we have already made a form named add.php in appliaction/view folder.

second, we made the file named footer.php where we place our Css and Js files. Before sending the form data to the controller we need to validate that data through javascript or jquery. Here, first we are using checkonlyletterspace( ) function to check the string that it contains only letters or spacing. Second, we are using uniqueemailforprofile( ) function to check the email that it already exists in the database or not by sending the email to the Home.php controller where, uniqueemailforprofile( ) function also exists in the controller to check the email in the database. After validating all the data we use ajax to send the form data to the controller named as Home.php. Make folder named assets in the root directory of your application. Copy the below code and paste it into file and save it as signup_validation.js inside assets folder in the root directory like application/assets/validation.php.

At last, create index method that will load the registration page as shown below.

Controller Method for signup system The controller is the main module or part that connect view to the model part. In controller we made a method named insertdata( ). In insertdata() method we are calling insert_data model that insert the data into the users table in the database and if the data is correctly inserted in the database it returns success message back to the controller. On the basis of message, we send 0 or 1 to our add.php view file. Create Home.php controller where make class named Home that extends the CI_Controller and place the below code inside that class.

Model Method for Signup System Here, first we need to make a User_model.php file inside application/model folder and within that file create class named User_model that extends the CI_Model. Also, create insert_data method and paste the below code under that.

In above code we have used two methods first one is insert_data( ) to insert data and the second one is randomuniquetoken( ) to generate 30 digit random number every time when the user wants to register. Here, token variable is used to provide every user a unique number which is then used for security purpose. Once, the data is stored in the database it will return the message according to that user. Login System Create login page that have fields email and password. Save that page as login.php in application/view. Also, below is the code for the login form.

In addition, create file that has validation functions to validate email and password. Save this file as login_validation.js in root folder named assets as assets/login_validation.js. Login_validation.js contains uniqueemailforprofile function to check that email exists in the database or not by sending the email to Home.php controller through ajax. Also, below is the login validation code.

In above code, after validating the email and password these data will be sent to the home controller through ajax. Also, that data is used for validating the data stored in the database and insert them if exist. Controller for login In home controller, we have created a method named checkpwdandlogin( ). In checkpwdandlogin() method we are calling checkpwdandlogin model that checks the data into the users table in the database and if the data is correctly matched with the stored data in the database it returns data of the user in associative array back to the controller. On the basis of that data we store the data into session and send 0 or 1 to our login.php view file. If we get 1 on login page it means user is authorized and if 0 will get then it means the user does not exist in the database. Also, below is the code for checking the email and password in the database.

Model for login Create a method in user_model to check whether email and password exist in the database or not, if exist then fetch the details of that user and send it back to the controller. Also, below is the code for the model named checkpwdandlogin. In the above code we are checking the email and password into the user table. If exist it means authorized user and return associative array of that user otherwise return null. User listing System Create a view named user.php in application/view folder. In this file, we are having foreach loop to fetch the data from JSON response data. Also, below is the code for showing the user details if exist.

In addition, we create controller method named show( ) in Home.php controller. Also, below is code for show( ) method. The function of show method is to fetch the data from users table and send it to users.php view. In above code first, we load the user_model file and then call the get_users( ) method to fetch the registered user data. At the end of code we are sending that data to user view. Model to get the users detail As we have already created view and controller file. Here, we are talking about the database select query to fetch the users detail on the basis of isactive field name. If, isactive field has value 1 it means the user is active and we get the data of that user. Also, below is the code for model method named get_users( ). In above code, we are having the condition that isactive field is 1 or not. If 1 then we will get the data as objects.

Important Links http://localhost/test/home/ ( This URL will open add user page as shown below. Here, test is your codeigniter application folder name and home is your main controller name.) http://localhost/test/home/loginpage ( This URL will open login page as shown below.)

http://localhost/test/home/show ( This URL will open Show page as shown below.) Conclusion In this post, we have learned how to make login, signup and user listing form in Codeigniter. In this, we have used validation script to validate text, email and password. So, if you like my post or have any query please comment below in the comment box.