codeigniter-3

Dynamic Database Switch - Codeigniter

不想你离开。 提交于 2019-12-13 03:46:13
问题 I want to switch my codeigniter multiple database on runtime. My Default database will run thoroughly the page but when I needed to switch to other database based on scenario or requirement then I can do. The common model function will work for the all different databases. So, I want to use same model and same function for multiple database connection using dynamic selector without using session or without passing function variable To achieve this I set a name in cofig and when I call my

Product category function not working in CodeIgniter

泪湿孤枕 提交于 2019-12-13 03:34:40
问题 I'm making a website in CodeIgniter and I'm trying to make a menu bar with all the categories, and when you click on a certain category it must show all the products that are in that category but its not really working. The categories are showing on the category side menu bar, but when I click on a certain category link its going to the right view page but instead of the product information I'm getting this error: A PHP Error was encountered Severity: Error Message: Cannot use object of type

How to connect code igniter 3.1.8 with sql server 2000

扶醉桌前 提交于 2019-12-13 03:32:26
问题 I'm trying to connect Code Igniter 3.1.8 with sql server 2000 but was not possible, i'm use php 5.6, Does someone know to make it works? this is my config database $db['default'] = array( 'dsn' => '', 'hostname' => '200.200.200.242\SERVERBARU', 'port' => '1433', 'username' => 'sa', 'password' => 'm45t3r', 'database' => 'DEPO2017', 'dbdriver' => 'sqlsrv', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => (ENVIRONMENT !== 'production'), 'cache_on' => FALSE, 'cachedir' => '', 'char_set' =>

Codeigniter: Database driver is not currently loaded

岁酱吖の 提交于 2019-12-13 03:21:35
问题 I got installed codeigniter 3 in a wampserver 3 with mysql, and the connection to the DB configured, and all is working well, models have connection and queries are returning data, however, when i'm using the profiler library, specially the function: $this->output->enable_profiler(true); It returns me the follow: I just want to see the queries that were runned but is showing: Database driver is not currently loaded Any idea about how to solve this? It is like the profiler doesn't get that the

CodeIgniter 3.0.3 ci_session not saving session data to ci_sesstion table

你说的曾经没有我的故事 提交于 2019-12-13 03:16:58
问题 I'm new to CodeIgniter and I'm having some issues with the login \ logout ci_session data now saving at all. I have setup the standard ci_session table using the script in the CodeIgniter docs and have setup the config file to allow session to be stored in the relevant table, but nothing is. config.php settinh for sessions: $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_encrypt_cookie'] = TRUE; $config['sess_use_database'] = TRUE; $config['sess

Redirect to a page based on user roles in codeigniter

扶醉桌前 提交于 2019-12-13 02:57:58
问题 Am working on a user login authentication with codeigniter. The login script works great. My question is, when a user is logged in I want the user to be redirected to a page based on his user roles Roles are as below subscriber , admin , client , postman User_model.php is as below class User_model extends CI_Model { public $status; public $roles; function __construct(){ // Call the Model constructor parent::__construct(); $this->status = $this->config->item('status'); $this->roles = $this-

How to display the live online user in the system using CodeIgniter?

ぐ巨炮叔叔 提交于 2019-12-13 02:35:35
问题 I am using CodeIgniter, I am showing live online user using CodeIgniter. I tried some code but I am confused now. Reference video. I learn from this video https://www.webslesson.info/2017/08/display-online-users-using-php-mysql-with-ajax-jquery.html OR Step:1 https://www.youtube.com/watch?v=aAG3w8l8lL8 Step:2 https://www.youtube.com/watch?v=L__8vVJT57U Here is my code. Login Password verify If the password is correct then It will insert the time and user id in the database. if ($result) { if

Codeigniter csrf token not in post array

∥☆過路亽.° 提交于 2019-12-13 01:28:56
问题 When posting a form with a csrf token, $this->input->post("csrf_token") is empty. I could post a duplicate csrf_token using another field name. But that looks a bit unnecessary. Is there (another) way to get it? __ All is done using AJAX. So first of all, a token must be requested, and is provided using a json template, populating it this way: $data["json"] = array( "csrf_token" => $this->security->get_csrf_hash() ); Using that token, a ajax POST request is done, sending user login, password.

access file outside public_html using codeigniter 3.X

柔情痞子 提交于 2019-12-12 23:48:29
问题 For security reasons I have the PDF files in a folder called Pdf located just outside the public_html . Im trying to access this file from my controller which lies inside the application folder. I tried using a couple of paths.. One being: ../../../../Pdf/{$name_hash}.pdf . The other being: /home/xx/Pdf/{$name_hash}.pdf I tried to include the file and send it as an js.openwindow as well as readfile($filepath) all to no avail! The files are existing and the name is also generated correctly by

Codeigniter - URI Disallowed characters

邮差的信 提交于 2019-12-12 20:55:57
问题 I have seen several other questions similar to this but I can't find a solution to my specific problem. I am getting error The URI you submitted has disallowed characters. When I send the following request: http://myrul/login/createNewPassword/reset_token/pwd70xkainz500d57311rli/username/contact%40email.com Now I have identified that the % in my username is what is triggering the error but I have that allowed in my config file. $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; I though this