codeigniter

Codeigniter session in wordpress

旧时模样 提交于 2020-01-05 06:09:07
问题 I have developed a website in codeigniter and integrated wordpress for blog. My problem is if i logged in the site, i am not able to use the codeigniter session value in the wordpress blog. In Codeigniter once i logged in i am setting the following session using codeigniter session. $this->session->set_userdata('get_user_session', $auD); Now i need to use the session in wordpress header file or index file. I tried the below code in wordpress. session_start(); print_r($_SESSION); I am not

check the file before downloading the file using php

依然范特西╮ 提交于 2020-01-05 05:36:06
问题 i want to check the file before downloading the file, i have controller Download and function download_file here is my code : i tired this code and i always get no public function download_file($namafile,$nofile) { $filecek =(site_url()."/uploads/file/".$namafile); $data = file_get_contents(site_url().'/uploads/file/'.$namafile); echo "$filecek"; if (!file_exists($filecek)) { echo "no"; }else { force_download($namafile,$data); echo "yes"; } } } and this is link for download <a href="<?php

CodeIgniter update_batch without replacing the previous data next updated value will puts by comma separated as increment

走远了吗. 提交于 2020-01-05 05:30:09
问题 Although I am not sure. update_batch is it possible to without replacing the previous data next updated value will puts by comma separated as an array-form on the SAME FILED . I shown 2 Demo image for better understand. My Code is already running for only batch update But not for update_batch increment value without replacing previous data! For example - For 1st time update , column field will shown like this at "t_franchise_price" column --- For 2nd time When next update will perform , then

404 page not found error in Codeigniter

时光怂恿深爱的人放手 提交于 2020-01-05 04:43:15
问题 I am new to the codeigniter framework and I have tried to make my first program but received a 404 page not found error This is my root directory Codeigniter and my directory structure My source folder contains the .htaccess file containing the following code RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] Home.php class Home extends CI_Controller{ public function index(){ $this->load->view('View'); } } view.php echo

Determine problem in CodeIgniter controller

你离开我真会死。 提交于 2020-01-05 04:37:14
问题 I've created a base controller that all of my controllers extend... class PublicController extends CI_Controller { private $js = array(), $css = array(), $templateVars = array(); public function __construct () { parent::__construct(); //register account $this->templateVars['account'] = ($this->account = $this->modelFactory('account')); // enable profiler for development if (ENVIRONMENT == 'development') { $this->output->enable_profiler(true); $this->addJs('jquery-min-1.5.2'); } else { $this-

CodeIginter, Mod_Rewrite on URLs and .htaccess

此生再无相见时 提交于 2020-01-05 04:37:07
问题 I'm unsure of which stackexchange site is best suited for this question as I could see it fitting in to several, especially depending on the ultimate answer. The challenge I'm facing is that I've written a site using CodeIgniter. The site is a fairly simple company site. I've used CodeIginter to implement clean urls and the ability to expand the site in the future. There is also a simple blog and "gallery" which are both dynamic, driven by a database. In my development environment, the site

Get values from html table using codeigniter

ぐ巨炮叔叔 提交于 2020-01-05 04:34:09
问题 How can I get the values from a html table and pass that to a controller in codeigniter? I'm passing an array to a view. I walk that array and display its content in a table where the user can alter the table. For example, adding a row, or deleting one, but changing values is a possibility too. But then the user saves the data by pressing the button 'save'. How do i get the data from the table and pass that to php? 回答1: When the "save" button is pressed you trigger a javascript function that

How to avoid “The action you have requested is not allowed” error with Knockout postJson function call

核能气质少年 提交于 2020-01-05 04:31:08
问题 CodeIgniter gives an error "The action you have requested is not allowed." when it fails the check for CSRF. As I understand it, this means the POST is missing the hidden token from the form that proves that an attack is not being done. The token is generated automatically with a call to the CI form_open function. In my case, I'm using Knockout to post the contents of a ViewModel for saving, like this: ko.utils.postJson($("form")[0], self.pages); I've found solutions elsewhere that simply

CodeIgniter Load File with data parameter

纵然是瞬间 提交于 2020-01-05 04:18:29
问题 Is there any option in CodeIgniter to load files with parameters like in views? In my Controller I load this File: $path_to_logic = "extended_core/plugins/saphir_e-cms/be_extensions/$this->modul_id/package/logic.php"; $logic = $this->CI->load->file($path_to_logic, true); I have an array() in the controller that I would pass to the loaded file, like the $data var in the views. 回答1: You need to add this functionality into the Loader class. In order to do that, create a new file named MY_Loader

Making live search on a database with CodeIgniter, php5 and MySQL

≯℡__Kan透↙ 提交于 2020-01-05 04:16:23
问题 I've got a little project I'm currently working on and its main idea is to create a good-looking user interface and grant the user the option to make searches on a given database. I've got a working CodeIgniter framework that runs on php5 and integrates with MySQL server that as for now only stores users and passwords. Moreover, I've got a login interface that grants a home page after a successful login (I know...not much, and clearly not something to be proud of). In the user homepage, I