Skip to main content

Posts

Showing posts from September, 2019

React JS

Installation  npm install - g create - react - app create - react - app my - app - name cd my - app - name npm start OR npx create-react-app myapp cd my - app - name npm start

Dynamic Model

<?php if (!defined('BASEPATH'))     exit('No direct script access allowed'); class Dynamic_model extends CI_Model {     public function __construct() {         parent::__construct();     } //**---FOR INSERT DATA     public function INSERTDATA($tablename, $feild = '') {         if (!empty($tablename) || !empty($feild)):             $this->db->set($feild);             $insert = $this->db->insert($tablename);             if ($insert):                 return $this->db->insert_id();             endif;         else: return "Invalid Input Provided";         endif;     } //**---FOR UPDATE DATA     public function UPDATEDATA($tablename, $where = '',...

Codeigniter initial setup

1. Download Latest version of codeignitor from "https://codeigniter.com/". OR Download from link below : https://drive.google.com/open?id=1K_VZEu2idorUS3vxHiIB5bIzIYt289kH 2. Extract .zip folder and rename it by project name. 3. Place that unziped folder into localhost htdocs folder. 4. Open project in browser as "localhost/projectname", Page with "Welcome to Codeignitor" will appears. 5. Open config.php inside application > config > config.php and set base URL "http://localhost/projectname". 6. Open database.php inside application > config > database.php and set hostname,username,password,database. 7. Create database and tables using localhost/phpmyadmin if not created. 8. Go to application > controller and create new file "Auth.php" as well as go to application > model and create new file Auth_model.php 9. Write this code inside Auth_model.php class Auth_model extends CI_Model { pub...

Remove htaccess

There are 3 steps to remove  index.php . Make below changes in  application/config.php  file $config [ 'base_url' ] = 'http://' . $_SERVER [ 'SERVER_NAME' ]. '/Your Ci folder_name' ; $config [ 'index_page' ] = '' ; $config [ 'uri_protocol' ] = 'AUTO' ; Make  .htaccess  file in your root directory using below code RewriteEngine on RewriteCond $1 !^( index\.php | resources | robots\.txt ) RewriteCond %{ REQUEST_FILENAME } !- f RewriteCond %{ REQUEST_FILENAME } !- d RewriteRule ^(.*) $ index . php / $1 [ L , QSA ] Enable the rewrite engine (if not already enabled) i.  First, initiate it with the following command: a2enmod rewrite ii.  Edit the file  /etc/apache2/sites-enabled/000-default Change all  AllowOverride None  to  AllowOverride All . Note: In latest version you need to change in  /etc/apache2/apache2.conf  file iii.  Restart your server with the following command: sudo / ...