codeigniter

Codeigniter what is the point of storing session data in the cookie ONLY? [duplicate]

寵の児 提交于 2019-12-25 09:48:37
问题 This question already has answers here : Why does codeigniter store its sessiondata in a cookie? (4 answers) Closed 6 years ago . all CI users know that by default sessions are stored in cookies. But what exactly is the point of this implementation? I really can't find a good reason. OK, in a shared server people might gain access to the session files but what about the client side? I could change the data in the cookie as well and being a "one-way" method how do I even validate the data in

Cannot Insert HTML on var using getElementById [closed]

烈酒焚心 提交于 2019-12-25 09:45:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I am trying to insert an HTML using my controller to a div, but I do not know what is wrong with my JS code, it always return Uncaught TypeError: Cannot set property 'innerHTML' of null. Is there anything I missed? My Controller: $this->load->model('model_admin','modeladmin'); $branchid = $this->input->post(

Cannot Insert HTML on var using getElementById [closed]

ぃ、小莉子 提交于 2019-12-25 09:45:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I am trying to insert an HTML using my controller to a div, but I do not know what is wrong with my JS code, it always return Uncaught TypeError: Cannot set property 'innerHTML' of null. Is there anything I missed? My Controller: $this->load->model('model_admin','modeladmin'); $branchid = $this->input->post(

how can i create product variant in codeigniter?

纵饮孤独 提交于 2019-12-25 09:30:16
问题 i want to create product variant for any product using codeigniter. i have product table and product variant table product table ------------------------------------------------------ id | category_id | title | price ------------------------------------------------------ 1 | 1 | plstic bucket | 200 2 | 2 | Big storage bucket | 500 product variant table variant_id | product_id | title | price ------------------------------------------------------ 1 | 1 | plstic bucket red small | 2 | 1 |

Pagination in code igniter

China☆狼群 提交于 2019-12-25 09:30:14
问题 I am do pagination in code igniter ,join two tables for Search purpose my Models's public function main_search_count($term) { if ($term == "NIL") $term = ""; $this->db->select('*'); $this->db->from('tbl_doctor'); $this->db->join("tbl_specialisation", "tbl_specialisation.spec_id = tbl_doctor.spec_id",'left'); $this->db->where("(tbl_doctor.dr_name LIKE '%".$term."%' OR tbl_doctor.district LIKE '%".$term."%' OR tbl_specialisation.spec_specialise LIKE '%".$term."%')"); $query= $this->db->get();

Mysql trigger return bad stocks value

試著忘記壹切 提交于 2019-12-25 09:17:33
问题 I need help with my trigger. I have two tables 'product' and 'storage'. The idea is when I run update on column 'flag' in table 'storage' trigger must calculate stock for right ID, but always return the wrong value for all product, please see attach. Right stock value should be for 'Test' 10 pcs and for 'aaaaaa' 5 pcs. Thanks for help. products table: CREATE TABLE `products` ( `id` int(11) NOT NULL, `subcategory_id` int(11) NOT NULL, `product_name` varchar(255) COLLATE utf8_bin NOT NULL,

CodeIgniter: Global Vars via Controller and Indirect modification of overloaded property

﹥>﹥吖頭↗ 提交于 2019-12-25 09:17:24
问题 A problem haunting me since early days of CodeIgniter and now, with the new CI 3 i want to see if there is a more elegant way to solve it. // file: application/core/MY_Controller.php class MY_Controller extends CI_Controller { public $GLO; function __construct(){ parent::__construct(); $this->GLO['foo'] = 'bar'; $this->GLO['arr'] = array(); } } then, later in the code, I need to get and set the values of the $GLO variable dynamically. So for instance: // file: application/controllers

How to save data and to add new tag and its data from select 2 multiple select tag

♀尐吖头ヾ 提交于 2019-12-25 09:14:19
问题 I followed a tutorial on making a multiple select tag mode in this link http://jsfiddle.net/dplanella/N6bQE/36/. PROBLEM: If I choose some value from the multiple select, how can I check if the I already select the data from the multiple select to be not shown once I open the multiple select again just like the link performed above? How can I update the values to the database once I finish chose value/s from the multiple select just like the link performed above? DONE Add new tag/s even the

CodeIgniter “sess_time_to_update” and Indy Cookies

╄→尐↘猪︶ㄣ 提交于 2019-12-25 08:57:09
问题 I have this horribly stripped delphi code that basically login to server, save cookie in a global cookie manager, then upload files in threads (using Delphi 2010 + Indy 10.4736) Each thread reads the global cookie manager and upload the file. Server side, I'm using PHP with CodeIgniter . Everything works just fine, except that CodeIgniter has this sess_time_to_update setting in config. This *sess_time_to_update* defaults to 300 seconds after which CodeIgniter completely regenerate the session

how can convert $files contain to array?

你。 提交于 2019-12-25 08:49:30
问题 How do I solve this error? A PHP Error was encountered Severity: Warning Message: Invalid argument supplied for foreach() Filename: admin/tour.php Line Number: 81 this is line 81: $files = $this->multi_upload->go_upload(); var_dump($files); $images = array(); foreach ($files as $img) { //line 81 $images[] = $img['file']; } this my $files in top code: function go_upload($field = 'userfile') { $CI =& get_instance(); // Is $_FILES[$field] set? If not, no reason to continue. if ( ! isset($_FILES[