How to Remove Index.php in CODEIGNITER FRAMEWORK
Steps to remove index.php from url codeigniter :- Config changes :- Go to “application/config/config.php” Find below code:- $config[‘index_page’] = ‘index.php’; Replace with the below code:- $config[‘index_page’] = ”; .htaccess changes :- If you not have any htaccess create new and place it on your root. Go to “application/config/config.php” Find below code $config[‘uri_protocol’] = ‘AUTO’; Replace with the […]
Set pagination in searching data in table [ codeigniter ]
Set Peginaation in Searching in codeigniter Controller Code: <?phpif (!defined(‘BASEPATH’)) exit(‘No direct script access allowed’);class User extends CI_Controller {function __construct() {// Call the Model constructorparent::__construct();$this->load->helper(‘url’);$this->load->model(‘nj_user’);$this->load->library(“session”);$username = $this->session->userdata(‘username’);if (empty($username)) {redirect($this->config->base_url() . ‘login’);}$this->load->library(“pagination”);}public function index() {redirect($this->config->base_url() . ‘user/view’);}//sarchingpublic function searchterm_handler($searchterm) {if ($searchterm) {$this->session->set_userdata(‘searchterm’, $searchterm);return $searchterm;} elseif ($this->session->userdata(‘searchterm’)) {//print_r ($_SESSION[‘searchterm’]);exit;$searchterm = $this->session->userdata(‘searchterm’);return $searchterm;} else {$searchterm = “”;return $searchterm;}}public […]
User "Status" Button in php codeigniter with ajax.
Hot to set user Active and Deactive Button in php Codeigniter with Ajax and Bootstrap. Controller Code: public function change_user_status($par = NULL) { $this->model_name->user_status($par); } Model Code: function user_status($st) { if ($st == “true”) { $this->db ->set(‘status’, “Active”) ->where(‘user_id’, $_POST[‘id’]) ->update(‘model_name’); } else { $this->db ->set(‘status’, “Deactice”) ->where(‘user_id’, $_POST[‘id’]) ->update(‘model_name’); […]
Block Browser Back Button using ‘JS’
script to block browser back button Just paste this following script in your victim web page and then save page and test it on your Browser Done… Here The script :- function preventBack(){window.history.forward();} setTimeout(“preventBack()”, 10); window.onunload=function(){null};
Codeigniter Paginaton With Bootstrap css
.bdr{ border:1px dotted rgba(34,56,235,1.00); background:rgba(192,192,192,1.00); } Bootstrap Paginaton With Codeigniter Bootstrap Paginaton With Codeigniter Controller Code::: Load Pagination library in your controler: $this->load->library(“pagination”); Code::– public function view() { // $data[‘result’]=$this->nj_user->getallUser();$this->load->view(‘layout/header’);$this->load->view(‘layout/sidebar’);//Pagination$config = array();$config[“base_url”] = $this->config->base_url() . “user/view”;$config[“total_rows”] = $this->nj_user->count_user();$config[“per_page”] = 7;$config[“uri_segment”] = 3;$choice = $config[“total_rows”] / $config[“per_page”];$config[“num_links”] = round($choice);//config for bootstrap pagination class integration$config[‘full_tag_open’] = ‘ […]
set pagination in php codeigniter with bootstrap css
Pagination In php Codeigniter With Bootstrap CSS Model Code:– <?phpclass department_model extends CI_Model{ function __construct() { // Call the Model constructor parent::__construct(); } //fetch department details from database function get_department_list($limit, $start) { $sql = ‘select var_dept_name, var_emp_name from tbl_dept, tbl_emp where tbl_dept.int_hod = tbl_emp.int_id order by var_dept_name limit ‘ . $start . ‘, […]
Block Right click on your web page
Block Right click on your web page To block right mouse click on your web page just copy the following link on your html page. Code:- “ function clickIE4(){ if (event.button==2){ alert(message); return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ alert(message); return […]