codeigniter

CodeIgniter: How to 'highlight' the link of the page the user is currently on?

拜拜、爱过 提交于 2019-12-30 04:49:12
问题 Fairly new to CodeIgniter, still grasping the MVC approach. I'm just wondering what's the best way to solve this: I got my navigation bar highlighting the currently active link like so: <a href="index.hml" id="active">Index</a> <a href="blog.hml">Blog</a> Now, when I go to blog.html I want id="active" to shift accordingly. Usually I'd assign a variable to each link and then set it's value to 'id="active'. Somehow I don't think that's the best way. Any thoughts? Update (12. Sept 2012) Since

Import excel files with image in php/mysql

安稳与你 提交于 2019-12-30 04:42:27
问题 I want to make an import script which allows users to upload their excel file (extension not important) to my php application. The application should reconize a list of items (so far so good). The difficulty in this case is that the excel files contain images... I've read information about phpexcel library but it does not say anything about images. Anybody ideas? 回答1: You can access images by PHPExcel library. For importing images: $objPHPExcel = PHPExcel_IOFactory::load("MyExcelFile.xls");

codeigniter MY_Controller not found

≯℡__Kan透↙ 提交于 2019-12-30 04:32:29
问题 i’m using the Codeigniter.2.1.3 for a website, so i need to extend the CI_Controller so i can add a method to be executed with all controllers so i did what’s in the user_guide: creating a file named MY_Controller.php in the application/core folder the creating in it MY_Controller Class that extends the CI_Controller, the changing my regular controller to extend the MY_controller like this: MY_controller.php: class MY_Controller extends CI_Controller{ protected $page; # Constructor function _

codeigniter & node js integration with now js - how to access view files

杀马特。学长 韩版系。学妹 提交于 2019-12-30 02:28:09
问题 i want to integrate codeigniter and node.js but i am having confusion that how to execute both node.js and codeigniter. I have successfully installed and ran the nowjs sample: http://nowjs.com/doc/example how to access view files of codeigniter(or any php framework) into node.js. i have confusion because codeigniter executed with url http://localhost/xyz while node.js executed with http://localhost:8080/xyz so which url i have to write in browser from which i can use both node.js &

CodeIgniter + jQuery(ajax) + HTML5 pushstate: How can I make a clean navigation with real URLs?

走远了吗. 提交于 2019-12-30 02:17:07
问题 I'm currently trying to build a new website, nothing special, nice and small, but I'm stuck at the very beginning. My problems are clean URLs and page navigation. I want to do it "the right way". What I would like to have: I use CodeIgniter to get clean URLs like "www.example.com/hello/world" jQuery helps me using ajax, so I can .load() additional content Now I want to use HTML5 features like pushstate to get rid of the # in the URL It should be possible to go back and forth without a page

Codeigniter extending controller, controller not found

拟墨画扇 提交于 2019-12-30 02:04:05
问题 In Codeigniter 2.1.2 I want to create base controller and then extends from this controller. It does not work and I have no idea why and I'm pretty desperate now. In \application\core\MY_Base_Controller.php I have this: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class MY_Base_Controller extends CI_Controller { function __construct() { parent::__construct(); ... In \application\controllers\Home.php I have this: <?php if ( ! defined('BASEPATH')) exit('No direct

Codeigniter extending controller, controller not found

给你一囗甜甜゛ 提交于 2019-12-30 02:03:29
问题 In Codeigniter 2.1.2 I want to create base controller and then extends from this controller. It does not work and I have no idea why and I'm pretty desperate now. In \application\core\MY_Base_Controller.php I have this: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class MY_Base_Controller extends CI_Controller { function __construct() { parent::__construct(); ... In \application\controllers\Home.php I have this: <?php if ( ! defined('BASEPATH')) exit('No direct

Facebook Login with Strict Mode for Redirect URIs

感情迁移 提交于 2019-12-29 09:36:31
问题 I'm developing a WebApp with Codeigniter 3, Facebook SDK and this this library for manage the request. Using the main tutorial for Facebook Login all things work fine. An example here: <?php $login = $this->facebook->login_url(); ?> <a href="<?=$login;?>"> Login with your Facebook account </a> After that I can do any request with the access token. With the new update, facebook apps must activate the Strict Mode for Redirect URIs. So in the developer portal I've activated my urls like this:

CodeIgniter is generating multiple sessions in the database. Why?

非 Y 不嫁゛ 提交于 2019-12-29 09:10:51
问题 I have a site which does a few ajax calls on page load. For some reason, CodeIgnitor is inserting 4 sessions (I'm assuming one for each ajax call) as you load the page. I'm storing the sessions in the database. I'm pretty sure there should only be one session per browser. Firefox seems to generate only one; other browsers seem to create a whole bunch of sessions. Multiple sessions for the same user are giving me some serious authentication problems. Why is this happening? How can I stop it?

CodeIgniter is generating multiple sessions in the database. Why?

烂漫一生 提交于 2019-12-29 09:10:03
问题 I have a site which does a few ajax calls on page load. For some reason, CodeIgnitor is inserting 4 sessions (I'm assuming one for each ajax call) as you load the page. I'm storing the sessions in the database. I'm pretty sure there should only be one session per browser. Firefox seems to generate only one; other browsers seem to create a whole bunch of sessions. Multiple sessions for the same user are giving me some serious authentication problems. Why is this happening? How can I stop it?