codeigniter

Codeigniter Pagination having page number in the middle of url

走远了吗. 提交于 2019-12-23 03:52:11
问题 I'm trying to use pagination class in codeigniter and my url looks something like this: blah.com/posts/browse/page/1/item_per_page/10 is there anyway to keep the page number in the middle of url? Thanks EDIT: $this->load->library('pagination'); $uri = $this->uri->uri_to_assoc(); $page = null; $item_per_page = null; if (count($uri)) { foreach ($uri as $key => $value) { $$key = $value; } } $config['base_url'] = base_url('posts/browse/page//item_per_page/1'); $config['uri_segment'] = 4; $config[

CodeIgniter: how to pass values from a specific function to another one

怎甘沉沦 提交于 2019-12-23 03:45:09
问题 I am trying to pass a value coming from a form using the method post from a function to another one. class Send_value extends CI_Controller { public function main_page() { $data['user'] = $this->input->post('fullName'); ... } public function welcome_page(){ //Now I would like to pass $data['user'] here. } } How can I pass it in the second function? 回答1: You need to pass parameter within that function and need to define that parameter as class Send_value extends CI_Controller { public function

using JQuery autocomplete from database with PHP (CodeIgniter)

亡梦爱人 提交于 2019-12-23 03:44:11
问题 So I want to use this plugin http://docs.jquery.com/Plugins/autocomplete I want to retrieve all the user names from database using codeigniter then store them in a var in javascript (If this is a good way) then use it in autocomplete. Also, I want the user if he/she enters any other text it wont be accepted, it has to be already stored in database only. Thanx in advanced :) 回答1: OK, Here is how I would structure it: First, you have to create a file to serve your data from your backend

Codeigniter Shopping Cart [closed]

北慕城南 提交于 2019-12-23 03:42:28
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . When i create a shopping cart with CI Cart Class, it add the product to the cart first 1 and then when i add that product to the cart next time it is also add 1 product not 2. I want to do it the quantity in the

Create An Optgroup from an Array of data

允我心安 提交于 2019-12-23 03:42:10
问题 I am using Codeigniter to query my database and return an array of data. I have got an array of data like so : Array ( [0] => stdClass Object ( [depot_id] => 1 [depot_name] => Stockton On Tees [depot_description] => Arriva Stockton on Tees Depot [depot_postcode] => TS18 3AW [depot_lat] => [depot_long] => [operating_company_id] => 1 [date_created] => 2014-02-14 10:24:17 [date_edited] => [edited_by] => [status] => active [operating_company_name] => Arriva North East [operating_company

Codeigniter Shopping Cart [closed]

社会主义新天地 提交于 2019-12-23 03:42:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . When i create a shopping cart with CI Cart Class, it add the product to the cart first 1 and then when i add that product to the cart next time it is also add 1 product not 2. I want to do it the quantity in the

Create An Optgroup from an Array of data

非 Y 不嫁゛ 提交于 2019-12-23 03:42:05
问题 I am using Codeigniter to query my database and return an array of data. I have got an array of data like so : Array ( [0] => stdClass Object ( [depot_id] => 1 [depot_name] => Stockton On Tees [depot_description] => Arriva Stockton on Tees Depot [depot_postcode] => TS18 3AW [depot_lat] => [depot_long] => [operating_company_id] => 1 [date_created] => 2014-02-14 10:24:17 [date_edited] => [edited_by] => [status] => active [operating_company_name] => Arriva North East [operating_company

Codeigniter build validation class at your own needs

落花浮王杯 提交于 2019-12-23 03:39:10
问题 I am working in codeigniter and Iam looking to make my own custom validation class using "Validation_form" library and my custom rule where I will place my own validation rules and use that from everywhere in my project, but this seems impossible, I tried in couples ways to handle this but nothing. Codeigniter kindle force me to make my callback methods in my controller but I need them in my library or "method" or wherever else!!! My question is, can I build an specific library where I'll

codeigniter image upload cant grab file name

▼魔方 西西 提交于 2019-12-23 03:32:42
问题 i have try and try and i just cant get my image to upload. And i cant grab my image name when i try to echo it out :S. can you see what im doing wrong. here is my controller: <?php //ADMIN PAGE if (! defined('BASEPATH')) exit('No direct script access'); class News extends CI_Controller { //Write post when logged in as admin function write() { //insert image $config['upload_path'] = APPPATH .'/archive/img/news/'; $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = '9000';

codeigniter removing index.php (possible problem with host)

﹥>﹥吖頭↗ 提交于 2019-12-23 03:32:08
问题 Hi everyone I'm having some problems when removing index.php in CodeIgniter. I created my application locally and it works fine but when I uploaded it, removing index.php doesn't seem to work. I have a feeling this could have something to do with my host, it's not the best and I've had problems before. It's hosted on Fatcow. So.. all my CodeIgniter files are located in a sub-dirctory called outfitr. e.g <root>/outfitr/ I have my .htaccess file located in this folder with the following taken