codeigniter

CodeIgniter flashdata not working after redirect

邮差的信 提交于 2020-02-25 02:36:47
问题 I have set the flash data like this $this->session->set_flashdata('dispMessage','my message is here')); I found that message in session library but not display in redirect page. and I am use the codeigniter version 2.2.0. Can anyone help...? 回答1: According to the session class page of the manual: CodeIgniter supports "flashdata", or session data that will only be available for the next server request, and are then automatically cleared. These can be very useful, and are typically used for

How to call a controller from another controller in codeigniter?

风格不统一 提交于 2020-02-24 11:33:08
问题 I want to load a controller function from another controller function using codeigniter. What is the suitable way to do this so when call it url should be changed also. 回答1: No You cant do it. What you have to do it is create that function in model and call it through your controllers. So it will work fine. Ex In Model function get_id() { //some argument } In controller 1 $this->Model_name->get_id() In controller 2 $this->Model_name->get_id() 回答2: yes you can (for version 2) load like this

Browser Cache issue in codeigniter

随声附和 提交于 2020-02-24 10:36:09
问题 I am new in code igniter.I created a login form and a logout section. When i press the logout section, the page will redirect to login section. And when i click the back button in the browser it will show the previous pages.When i click the clear recent history and the choose cache,and then press the back button, it will not show the recent pages.It only shows the login section. How to overcome this?Please help me... 回答1: In the .htaccess file please add the lines: <IfModule mod_headers.c>

Can't get result from $this->db->last_query(); codeigniter

邮差的信 提交于 2020-02-24 05:12:04
问题 Quite a simple thing to ask and must be discussed many times, but I still not able to get the result of $this->db->last_query();. $this->db->select('count(*) as totalverified,res_sales.upduser, employee.name'); $this->db->from('res_sales'); $this->db->join('employee','employee.user_id = res_sales.upduser'); $this->db->where('date>=', $fromdate); $this->db->where('date<=', $todate); $this->db->where('verificationnumber<>', ''); $this->db->where('verificationnumber<>', NULL); $this->db->group

Jquery DataTable with Ignited-Datatables CodeIgniter

折月煮酒 提交于 2020-02-22 10:56:27
问题 Update: I finally found the solution for this problem. If you face the same problem as mine, you can try visit this link I am having problem when want to integrate Jquery DataTables with CodeIgniter Ignited-Datatables library When I use the default DataTables sServerMethod property which is "GET", I got the json response with data from my php. However since CodeIgniter use post, I stuck at loading server data although the function return me correct json output. So I follow this guide to

CI: Best practice for use same function in controller

匆匆过客 提交于 2020-02-21 06:08:45
问题 I have class name Deal and have function inside it which name is addit class Deal extends CI_Controller { public function addit() { //my function } } And I have another controller name Public and I want to use function addit which belong to class Deal by extend it. class Public extends Deal { public function addit() { //my function } } I quite new in Codeigniter and just read few references, looking at another question on this site, and already had some answers, but I dont know which one is

RewriteCond REQUEST_URI - ^ doesn't work as expected

自古美人都是妖i 提交于 2020-02-19 07:02:58
问题 I'm building a site in codeigniter. I have a series of rewrite conditions & rules in the .htaccess file. The first set of rules turns SSL on or off depending on the first segment of the uri. Then it loops through again & if it finds a match, redirects the page appropriately. If there is no match, and the uri does NOT start with any of the strings listed, it redirects you to another page. If no conditions are met, it goes to the index page. The problem is with my first set of rules that turn

RewriteCond REQUEST_URI - ^ doesn't work as expected

天大地大妈咪最大 提交于 2020-02-19 07:01:30
问题 I'm building a site in codeigniter. I have a series of rewrite conditions & rules in the .htaccess file. The first set of rules turns SSL on or off depending on the first segment of the uri. Then it loops through again & if it finds a match, redirects the page appropriately. If there is no match, and the uri does NOT start with any of the strings listed, it redirects you to another page. If no conditions are met, it goes to the index page. The problem is with my first set of rules that turn

RewriteCond REQUEST_URI - ^ doesn't work as expected

女生的网名这么多〃 提交于 2020-02-19 06:59:13
问题 I'm building a site in codeigniter. I have a series of rewrite conditions & rules in the .htaccess file. The first set of rules turns SSL on or off depending on the first segment of the uri. Then it loops through again & if it finds a match, redirects the page appropriately. If there is no match, and the uri does NOT start with any of the strings listed, it redirects you to another page. If no conditions are met, it goes to the index page. The problem is with my first set of rules that turn

CodeIgniter: Can't load database from within a model

故事扮演 提交于 2020-02-15 18:35:32
问题 I've written a new model for my CodeIgniter framework. I'm trying to load the database from within the constructor function, but I'm getting the following error: Severity: Notice Message: Undefined property: userdb::$load Filename: models/userdb.php Line Number: 7 Fatal error: Call to a member function database() on a non-object in /var/www/abc/system/application/models/userdb.php on line 7 Here is my model: <?php class userdb extends Model { function __construct() { $this->load->database();