codeigniter-url

CodeIgniter Paging 404

落花浮王杯 提交于 2019-12-23 03:32:00
问题 I've checked several threads on here regarding paging in CodeIgniter but I haven't found a solution to my problem. I have a controller class located at controllers/admin/index.php called 'Index' that contains the following code: class Index extends CI_Controller { public function __construct() { parent::__construct(); $this->load->helper("url"); $this->load->helper( 'events_helper' ); $this->load->helper( 'delegates_helper' ); $this->load->model( 'admin/event_model' ); $this->load->model(

Codeigniter Dynamic Routing

孤街浪徒 提交于 2019-12-22 12:38:05
问题 Hi i wont to make something like that. http:// example.com/ - Main Controller http:// example.com/rules/ - Main Controller where content get from database, but if not exist return 404 page. (It's ok, isn't problem.) But if i have subfolder in application/controlles/rules/ I want to redirect it to Main Contorller at Rules folder. This follow code can solve problem, but i don't know how it right realise. At routes.php: $route['default_controller'] = "main"; $route['404_override'] = ''; $dirtest

CodeIgniter Session Failing only in China

夙愿已清 提交于 2019-12-22 04:37:29
问题 OK I've spent 3 days trying to find out what's going on here and I'm stumped. The site is built with CI. (http://horizoneslchina.com) For a while I was getting Disallowed Key Characters whenever anyone in China. I extended the core Input class with the following: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class MY_Input extends CI_Input { function _clean_input_keys($str) { $config=&get_config('config'); if(!preg_match("/^[".$config['permitted_uri_chars']."]+$/i

Codeigniter: Base_url doesn't seem to be working

丶灬走出姿态 提交于 2019-12-20 05:12:26
问题 I have developed a simple site that fetches tweets from the Twitter public timeline, caches them for 60 seconds and so on. I have recently moved hosts from Hostgator to Mediatemple and my site was previously working fine on Hostgator. My application doesn't use a database connection, nor does it use any form of flat-file database either. Tweets are cached in an XML file stored in the root directory, not that most of that is important. The url helper is being included as can be seen below

Unable to load the requested file - CodeIgniter

我与影子孤独终老i 提交于 2019-12-13 15:10:44
问题 I'm trying to include a PHP file called includes.php which is not contained within the normal Views folder. The file contains links to the JS files to be loaded with this particular theme. includes.php resides within the scripts folder: | assets | | themes | theme_name | css | img | scripts | application | system In my controller I'm using $this->load->helper('url') which always works fine, and within the View I'm trying to call the following: $includes_url = asset_url() . 'themes/' . $theme

Customize dynamic URL.change ?id to name

左心房为你撑大大i 提交于 2019-12-12 04:55:55
问题 I'm using codeigniter for make dynamic website. In news page, I use url method like: http://test.com/test/test/news_details?id=27 how can i change my url to put news title within ?id=27 example: http://test.com/test/test/news_details/pass-this-url "pass-this-url" refer to id=27. Best Regards. 回答1: Use routes : http://www.codeigniter.com/user_guide/general/routing.html In your case it will be something like this : $route['pass-this-url'] = "test/test/news_details?id=27"; So http://www.example

Why redirect function in CodeIgniter not working?

醉酒当歌 提交于 2019-12-12 02:55:43
问题 I have a really weird problem. I have been using CI for more than 2 years and it's the first time I found this kind of problem. I found that the redirect function is not working properly. I already load the url helper in autoload.php. $autoload['helper'] = array('url','html','form','file'); What I want to do is to redirect the users to a controller if they call admin controller. class Admin extends CI_Controller { function index(){ redirect('secure'); } } But what happen is the page

Codeigniter 404 can't find index.php (only on real server, not on virtual server)

北城余情 提交于 2019-12-11 18:35:45
问题 I got a working webpage with CodeIgniter. I did now just upload it to my webserver and it gives me a 404 error. The browser address is "web-page.com/folder/en/about" The baseurl in the config is "web-page/folder/" Also this is in the config.php, I did try AUTO but it does not work either. $config['index_page'] = ""; $config['uri_protocol'] = "QUERY_STRING"; The index.php is in "web-page.com/folder/" My htaccess is in "web-page.com/folder/.htaccess" The content of the .htaccess is AddCharset

Rename file in CodeIgniter

烂漫一生 提交于 2019-12-11 12:10:48
问题 I have a file 1353683037.jpg in the tmp folder as shown below: C:\xampp\htdocs\ci_project\public\images\tmp\1353683037.jpg I need to rename this file to: C:\xampp\htdocs\ci_project\public\images\main\1353683037.jpg To do this, I have done the following: $file = '1353683037.jpg'; $dir = './public/images/'; rename($dir.'tmp\'. $file, $dir.'main\'. $file); I'm having the follwing reply from the server: A PHP Error was encountered Severity: Warning Message: rename(./public/images/tmp/1353683037

Codeigniter - the requested URL was not found on this server

依然范特西╮ 提交于 2019-12-11 11:27:30
问题 For the last couple of days my frustration has grown to new heights. Im trying to do a simple login system in codeigniter and I cant get it to work properly. when submitting the login form I get the following error: The requested URL /wishlist/login_controller/login was not found on this server. Here is the form: <form method="post" action="<?php echo base_url()?>login_controller/login"> <input type="text"placeholder="E-mail" id="email" name="email"> <input type="password" placeholder=