codeigniter

CodeIgniter htaccess mod_rewrite not working properly

断了今生、忘了曾经 提交于 2019-12-30 07:23:50
问题 I'm trying to make the url into http://127.0.0.1/dev/blog/welcome but when I type that it changes the url to http://127.0.0.1/dev/blog/index.php/welcome But When I do http://127.0.01/dev/blog//welcome it stays like that for some reason. my .htaccess is RewriteEngine On RewriteBase /dev/blog RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|images|robots\.txt|css) RewriteRule ^(.*)$ index.php?/$1 [L] and my config.php is configured $config[

codeigniter default controller url routing

家住魔仙堡 提交于 2019-12-30 07:23:08
问题 I am putting together a simple networking site and would like to have the urls work similar to facebook so by typing in domain.com/username I would get a user profile. I can do this already this way Logged in users profile at domain.com/ other users profile at domain.com/home/username The default controller is called home and I am currently using the _remap function to check for extra url parameters to display different data based on what is or isn't passed. My question is how would I map

codeigniter default controller url routing

别来无恙 提交于 2019-12-30 07:23:02
问题 I am putting together a simple networking site and would like to have the urls work similar to facebook so by typing in domain.com/username I would get a user profile. I can do this already this way Logged in users profile at domain.com/ other users profile at domain.com/home/username The default controller is called home and I am currently using the _remap function to check for extra url parameters to display different data based on what is or isn't passed. My question is how would I map

CodeIgniter: Parse dynamic language captions located in javascript

ⅰ亾dé卋堺 提交于 2019-12-30 07:19:08
问题 I have a javascript code that needs localisation, ie. function js_proc() { var some_data = 'this text needs to be translated dynamically at runtime'; } So I re-wrote like this: function js_proc() { var some_data = <?php echo $this->lang->line('some_data_id'); ?>; } In the view, I wrote the js link like this: <script type="text/javascript" src="www.domain.com/codeigniter/get_js/file-1/"></script> which calls the function get_js() in the controller. The idea is to have the get_js() function

CodeIgniter 2.0 - validating arrays

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-30 07:18:18
问题 I'm having some problems converting a piece of form validation code to CI 2.0. I'm trying to validate an array of checkboxes but for some reason validation fails to run the callback or doesn't validate. How can I validate an array of checkboxes so that at least one is checked and values must be one of the options (key of an options array)? EDIT: Here is a better explanation of where it is failing me. Lets say I has these fields: <input type="checkbox" value="1" name="purpose[]" /> <input type

Can we Integrate Laravel project as a library in CodeIgniter?

拈花ヽ惹草 提交于 2019-12-30 07:09:09
问题 I want to increase the functionality of my CodeIgniter project by integrating some code that is written in laravel? how do I approach, Can I include the code via library in CodeIgniter ? If yes How? I only want to include controllers and ORM into the CI. Laravel code is a kind of api fetcher with function talks with other 3rd party services. 回答1: Yes you can use composer to install Laravel specific modules/projects, third-party projects in your CodeIginter. Just include autoload in your

Facebook PHP-SDK with CodeIgniter not returning $_REQUEST['signed_request']

强颜欢笑 提交于 2019-12-30 06:55:50
问题 class Example extends CI_Controller { function __construct() { parent::__construct(); } function index() { $this->load->library('facebooklib'); $user = $this->facebooklib->getUser(); if ($user) { try { $data['user_profile'] = $this->facebooklib->api('/me'); } catch (FacebookApiException $e) { $user = null; } } var_dump($_REQUEST); if ($user) { $data['logout_url'] = $this->facebooklib->getLogoutUrl(); } else { $data['login_url'] = $this->facebooklib->getLoginUrl(); } $this->load->view('view',

jquery ajax returns error but is success

懵懂的女人 提交于 2019-12-30 06:40:11
问题 I have the following JS function change_ajaxarea1(){ navigator.notification.activityStart(); $('#ajaxarea1').load('http://server.net/droiddev/backbone1/index.php/welcome/', function(){ navigator.notification.activityStop(); $('#ajaxarea1').css("height","auto"); //$('#ajaxarea1').css("overflow","hidden"); }); //navigator.notification.activityStart(); } function postarticle(){ $.post("http://server.net/droiddev/backbone1/", { headline: "John", article: "2pm" } ); } function addarticle(){ var

How does CodeIgniter know a cookie holds valid session data?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-30 05:39:26
问题 In CodeIgniter, session data are saved in a cookie by default. But there must be also a file on my server (named as the session ID) to verify that the data (in the cookie) is valid, or am I wrong? I'm searching for the location where the sessions are saved. I've already looked in the "session.save_path" directory (/var/lib/php5), but in this directory there are only other sessions, but not the CodeIgniter sessions. I'm not saving the sessions in the database either, so how does CodeIgniter

Codeigniter xss_clean dilemma

匆匆过客 提交于 2019-12-30 05:13:33
问题 I know this question has been asked over and over again, but I still haven't found the perfect answer for my liking, so here it goes again... I've been reading lots and lots polarizing comments about CI's xss_filter. Basically majority says that it's bad. Can someone elaborate how it's bad, or at least give 1 most probable scenario where it can be exploited? I've looked at the security class in CI 2.1 and I think it's pretty good as it doesn't allow malicious strings like document.cookie,