codeigniter

Codeigniter isn't routing right

I installed Apache for Windows. I bought CodeIgniter Professional and downloaded their source code. It said that I should put its .htaccess in the root folder of the website so I did. I set base URL to be http://127.0.0.1/kids/ where kids is the root folder of the website. It showed the homepage just fine. When I clicked on a link, it al...

codeigniter - get current array position while doing foreach $object->result_array()

get current array position pointer while doing foreach $object->result_array() Hi, consider this, a case. foreach($object->result_array() as $rs) { //how do i display the current array element index that is the iteration index. //i want to call a function when the iterator is in the last-1 position. // and more specifically...

create main page with codeigniter

Hi, How can i create a main page with codeigniter? That page should contain a few links like login, register, etc. I followed a tut to create a login screen. But it made codeigniter only for that purpose. This is the site i'm talking about: http://tutsmore.com/programming/php/10-minutes-with-codeigniter-creating-login-form/ So basic...

Codeigniter first segment URL variables

I am looking to use a URL shortening scheme where I would like the variable to be in the first segment of the URL, www.example.com/0jf08h204. My default controller is "home.php" and I have .htaccess mod-rewrites in place, so what is the best way to manage this? I suppose my smarts have been blocked by the standard /controller/method/vari...

How to load Model into Model (Codeigniter)

How to load model into another model in Codeigniter? ...

Codeigniter: Userdata--When/Why/How to use

When is the proper time to use userdata? Why is it good/not good? And how should I use it properly? When is it bad/not conventional to use? Specifically, what's the best convention/method to utilize the session class: http://codeigniter.com/user_guide/libraries/sessions.html ...

Is there an ajax library for CodeIgniter that can invoke private controller methods and that currently works?

Hi there. Last time I did PHP I worked with CodeIgniter. To implement AJAX I used the XAJAX library, which was extremely simple and was capable of invoking private controller methods. Unfortunately XAJAX does not seem to be compatible with the latest version of CodeIgniter, or it might just be that it is not compatible with php5.2/5.3. ...

Codeigniter: Set 'global variable'

If I want to set a variable that my whole controller can access, how do I do it? Right now, in every function I am setting $id = $this->session->userdata('id'); I'd like to be able to access $id from any function w/o defining it for each controller. :) If there's a better way, I'm all ears! I'm a noob! ...

Code Igniter without a Database?

Hi everyone! Sorry if this is a simple question, is it possible to load codeigniter without a db setup? I have sess_use_db set to false in the config, I tried renaming database.php to something else but it still wants to load it, I turned active records off also. I tried commenting everything out in the database.php and it said no da...

MVC/HMVC and Object Oriented programming

I've been reading and learning about Object-Oriented programming (Head First Object-Oriented Analysis and Design and Code Complete: A Practical Handbook of Software Construction – thanks to suggestions found on StackOverflow). I've also been learning how to use a couple PHP MVC frameworks (specifically Codeigniter and Kohana). Some of ...

CodeIgniter better script flow for Query

Hi there, I've the following data: promo_id date time reg_cnt notes 2760 2010-06-02 01:30:00 2 - 2760 2010-06-02 05:30:00 2 - 2760 2010-06-03 07:00:00 1 - 2760 2010-06-03 07:30:00 2 - 2760 2010-06-03 08:30:00 3 - 2760 2010-06-04 09:00:00 1280 promo from vendor xxx 2760 ...

Time zone problem in Codeigniter

I have set the default time zone like date_default_timezone_set('America/New_York'); But the time is exactly 4 hrs advance. (ie) if Current time is 6:00:00 then its saving as 10:00:00 Don't know whats wrong. Its working perfectly in localhost but not in godaddy server. ...

code igniter with flex is it good combination?

Hi, im looking forward flex php developers about their works with CI and flex combination. did you guys feels good and keep things innovative and im just looking for working samples you have or you came across . Thanxs, Gobi :) ...

Codeigniter form_dropdown issues

I need a bit of help. I have this in my view $salutation = array( 'Mr.' => 'Mr.', 'Mrs.' => 'Mrs.', 'Dr.' => 'Dr.', ); echo form_open('membership/update'); echo form_dropdown('Salutation', $salutation, 'Mrs.'); The dropdown works in all but one fashion, it does not pre-select 'Mrs.'. How ...

How do I organize a set of actions across multiple models in CodeIgniter?

I have many models, let's say "Model1", "Model2" and "Model3". I have a certain group of actions that usually calls a method from each of these models and executes them in order: $user_info = $this->load->User_model->load( $user_id ); $this->load->Car_model->deleteCarsForUser( $user_info ); $this->load->Message_model->sendMessage( "Car ...

load .swf file quickly at client side !!!

Any tips or methods(encryption, plugins etc) to load flash files (i.e. swf) as quickly as possible at the client side ??? consider files size is between 5MB - 10MB.... ...

Database Error Handling problem in CodeIngniter

Hi, I use CodeIgniter as my web application framework. I used a simple Try/Catch and I sent a sample value to test it, and it failed! I know I can use $this->db->escape() function to solve my data problem but I just want to know: Why TRY/CATCH can not catch this error! Controler code: $this->load->model('user_model'); $result...

MySQL Active Record problem

I'm using MySQL ActiveRecord with CodeIgniter to submit queries, but have run into some snags when using the "select" function. For instance, this MySQL query works perfectly within phpMyAdmin: SELECT review_id, firms_name FROM reviews AS r JOIN firms AS f ON f.firms_id = r.review_target_id WHERE r.review_id =3 ORDER BY r.review_timest...

Programatically scaling rackspacecloud servers up and down through API

I was speaking with Rackspace tech support today looking for a simple solution to scale my server up / down based on load and he said that it could be done through their API programatically. Has anyone actually done this before or have any advice on how to best approach this? I'd love to know if someone has some outline code or notes b...

URL routing problem in codeigniter

Hello all I am trying to route a URL using codeigniter URL routing. I want to redirect a url like /users/edit?email to userController/editemail /users/edit?password to userController/editpassword I tried using the following line in routes.php in config folder $route["users/edit?(email|password)"] = "userController/edit$1"; This ...