Skip to main content

Posts

Server side datatable using codeigniter 3

  What is server side datatables? Server side datatables are used to show large data sets. Advantage of server side datatables. Data processing will be server side. Show large data sets. Server-side rendering is better for SEO than client-side rendering, as it can speed up the loading time of your page, improving user experience and helping your site rank higher in Google search results. Using server-side rendering here has the benefit of keeping the information on the server-side and not delivering it to the client, even if you pull from relational databases or NoSQL stores. HTML Code <div class="tab-pane fade show active" id="tab10">           <section class="main--content" style="padding:0px;" >                 <div class="panel">                  ...

Codeigniter Login Form using Ajax: Codeigniter Club

Codeigniter login form with validation using Ajax In this tutorial, we will understand how to create a simple login form using Codeigniter.  Create database table using Mysql database create login table in mysql database. Just copy paste query in Mysql database. CREATE TABLE `login` ( `id` int(11) NOT NULL, `user_id` int(25) NOT NULL, `session` varchar(10) NOT NULL, `system_ip` varchar(100) NOT NULL, `login_at` datetime NOT NULL DEFAULT current_timestamp(), `logout_at` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; Create view create a file in view folder with the name of  loginpage.php . <div class="container-scroller"> <div class="container-fluid page-body-wrapper full-page-wrapper"> <div class="content-wrapper d-flex align-items-center auth px-0"> <div class="row w-100 mx-0"> <div cl...

How to secure codeigniter website?

CSRF Protection (Cross-Site Request Forgery) CSRF process of an attacker tricking their victim into unknowingly submitting a request. CodeIgniter provides CSRF protection out of the box, which will get automatically triggered for every non-GET HTTP request, but also needs you to create your submit forms in a certain way. URI Security CodeIgniter contain following character in URI ·          Alpha-numeric text (Latin characters only) ·          Tilde: ~ ·          Per cent sign: % ·          Period: . ·          Colon: : ·          Underscore: _ ·          Dash: - ·          Space Password Handling ·        ...

MVC (Model View Controller) : Codeigniter Club

MVC will divide an application into three functional parts: Models  — deals with your database, carries out computations, and more. In short, it is where your business logic is located. Views  — forms the presentation layer of the application, where the data from your  models  are embedded. Controllers  — used to connect  models  and  views . A controller will route user requests to the appropriate  model.  After that, once the model has done its job, the controller loads the relevant  view. This architectural pattern also gives developers the flexibility to reuse code for multiple views. For example, you can apply the same navigation bar on every webpage of your application. Moreover, as both  views  and  models  are entirely separate, the front-end developers can work in parallel with the back-end team to speed up the development process. Note that CodeIgniter also subscribes to  Object-Oriented Programmin...

Codeigniter installation & setup: Codeigniter Club

                    Windows Environment   Install XAMPP or WAMP   Download and Unzip the package from Codeigniter.com   Extract all the documents in the server space (htdocs or www directory) Linux Environment  Download and Unzip the package from Codeigniter.com  Place the extracted folder in /var/www (in WAMP) or xampp/htdocs (XAMPP) Base URL   Go to application/config/config.php  Define base URL as $config['base_url'] = 'http://localhost/path/to/folder'; How to remove index.php from URL? go to root  create htaccess file  Add below code inside it  RewriteEngine on RewriteCond $1 !^(index\.php|assets|image|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] Note: .htaccess code varies depending on the hosting server. Some hosting servers (e.g.: Godaddy) need to use an extr...

What is Codeigniter?

Welcome to Codeigniter Codeigniter is an Application development framework. Codeigniter framework is based on the Model-View-Controller development pattern. MVC is a software approach that separates application logic from presentation. Current Version Codeigniter 4 Old Version Codeigniter 3 Model Model is used to access data from the database. If we need to get data from the database so we have to create a query (logic) for the database. View The view is used to create a view of the website. We can say, design of the website. We can create view (HTML, CSS, JavaScript, Ajax etc.). Users directly interact with the view of the website. Controller A controller is responsible for controlling the way that users interact with the MVC application. A controller is used to create logic for an application.  

Codeigniter registration form with validation using Ajax: Codeigniter Club

Codeigniter registration form with validation using Ajax In this tutorial, we will understand how to create a simple registration form using CodeIgniter.  Before starting we have to create a  Unique constraint (email id is a unique constraint in the database table) because if we enter a  Duplicate email id the  database will through a duplicate entry error and we can print an error. Otherwise, we can use another method using programming. we can check email-id already exist or not.  Create database table using Mysql database CREATE TABLE `registration` ( `id` int(11) NOT NULL, `username` varchar(100) NOT NULL, `email` varchar(100) NOT NULL, `country` varchar(100) NOT NULL, `password` varchar(200) NOT NULL, `agree` varchar(10) NOT NULL, `created_at` datetime NOT NULL DEFAULT current_timestamp(), `update_at` datetime NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; Insert Data  INSERT INTO `registratio...