codeigniter

CodeIgniter 2 not allowing multiple level subfolders for controllers

拟墨画扇 提交于 2019-12-23 15:06:32
问题 As I read the doc, controllers in CodeIgniter are supposed to support multiple level subfolders, but as far as I have tested, it is impossible to work after first a first level folder. By example: mysite.dev/ (index page, default controller home.php, works) mysite.dev/admin/ (admin section, in admin/home.php, works) mysite.dev/admin/manage/ (in admin/manage/home.php, do not work) I am trying to know why and how to make it work on multiple level sub folders? Thanks in advance! 回答1: CI only

Security class in Codeigniter

徘徊边缘 提交于 2019-12-23 13:15:46
问题 I'm trying to use the Security class in Codeigniter 2.0.2 but I cant seem to find the class to load. Is it hidden somewhere? Security Library as shown in CI user guide: http://codeigniter.com/user_guide/libraries/security.html Tried searching /system/libraries but it is not there... Trying to load the security class with $this->load->library('security'); gives me an error: Unable to load the requested class: security 回答1: It is in helper according to codeigniter user guide try $this->load-

Codeigniter: Unable to connect to your database server using the provided settings

末鹿安然 提交于 2019-12-23 13:05:26
问题 I use codeigniter as cms framework, if database hostname is localhost, it works correctly. $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'root'; $db['default']['password'] = 'test'; $db['default']['database'] = 'jinma'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; Using above configuration works correctly, but if hostname is changed to: $db['default']['hostname'] = '192.168.1.222'; A Database Error Occurred:

Update and Join query together in codeigniter?

喜欢而已 提交于 2019-12-23 12:49:24
问题 Updating data while join two tables but it gives an error in where condition can i use join and update together in a query ? here is my code public function update_model($id,array $data) { //$textArea=$data['textdata']; $this->db->join('user_data', 'user.id = user_data.id'); $this->db>where('user_data.id',$id); $this->db->update('user_data',$data); $query=$this->db->get(); return $query->result(); } I got Error like below in my mysql Fatal error: Uncaught Error: Call to undefined function

Codeigniter Inserting Multidimensional Array as rows in MySQL

帅比萌擦擦* 提交于 2019-12-23 12:46:44
问题 Please Refer to this question I asked Codeigniter Insert Multiple Rows in SQL To restate <tr> <td><input type="text" name="user[0][name]" value=""></td> <td><input type="text" name="user[0][address]" value=""><br></td> <td><input type="text" name="user[0][age]" value=""></td> <td><input type="text" name="user[0][email]" value=""></td> </tr> <tr> <td><input type="text" name="user[1][name]" value=""></td> <td><input type="text" name="user[1][address]" value=""><br></td> <td><input type="text"

Codeigniter : Validating two fields

拥有回忆 提交于 2019-12-23 12:26:00
问题 I have two numeric fields to collect data from users. Need to validate it using codeigniter form validation class. Conditions: First field can be zero Second field cannot be zero First field should not be equal to second field Second field should be greater than first field Currently I use $this->form_validation->set_rules('first_field', 'First Field', 'trim|required|is_natural'); $this->form_validation->set_rules('second_field', 'Second Field', 'trim|required|is_natural_no_zero'); But, how

Error : This feature is not available for the database you are using

感情迁移 提交于 2019-12-23 12:20:47
问题 I am using oci8 as my database driver in Codeigniter. While using the following code that calls a stored procedure gives me error : $this->db->call_function('update_letter_body', $body_letter, $insert_id); Error : This feature is not available for the database you are using. What should be done to make this work ? I am trying to set a value that has more than 4000 characters which doesn't seem to work from direct query and seems like the codeigniter does not support calling functions for

Fatal error: Call to a member function where() on a non-object codeigniter $query->num_rows()==1) [duplicate]

落爺英雄遲暮 提交于 2019-12-23 12:19:45
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: CodeIgniter - Call to a member function select() on a non-object I'm newbie with codeigniter and have some problems. Error Message: Fatal error: Call to a member function where() on a non-object in C:\xampp\htdocs\moi\CI\application\models\model_users.php on line 12 My Model: class Model_users extends CI_Model { function __construct(){ parent::__construct(); } public function can_log_in() { $this->db->where(

CodeIgniter: View doesn't load if I use die() function

为君一笑 提交于 2019-12-23 12:17:32
问题 I have the following code. Checks if the user is logged in or not. When the variable $is_logged_in is not set or is False, I load a message view. Unfortunately, at the same time the system loads the restricted content view. So I used die() function, and now only shows a blank page. What can I do to only load the message view when the user is not logged in? Thanks. if(!isset($is_logged_in) OR $is_logged_in == FALSE) { $data['main_content'] = 'not_logged_in'; $data['data'] = ''; $this->load-

Codeigniter Htaccess and URL Redirect issues

拟墨画扇 提交于 2019-12-23 12:08:54
问题 I am trying to use .htaccess on CodeIgniter, but it is not working. I have already set: AllowOverride All $config['index_page'] = ''; $config['uri_protocol'] = 'REQUEST_URI'; I am using XAMPP on Windows. My .htaccess : RewriteEngine On RewriteCond $1 !^(index\.php|images|scripts|css|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] My URL still contains index.php and, if I try to remove it manually, it returns a 404 error Also my other concern is my login page: whenever I login, my URL is