codeigniter

Inheritance in MVC - CodeIgniter

I am building a series of forms, and I am trying to inherit the functionality of a parent Form class into all the forms. For example, LeaveForm extends Form (Model) LeaveFormController extends FormController I am handling all the leave form specific stuff in LeaveFormController and LeaveForm. In LeaveFormController construc...

How strong CodeIgniter is comparing to Zend Framework? especially for developing a hotels directory portal...

Hi friends, When I decided to start using php framework, I have gone for CodeIgniter because of I didn't have much learning time, I had strict project dead-line. I actually wanted Zend Framework so much. I'm happy with CI so far... But I'm about to start a big hotels directory project like kayak.com . My project will not have so big db ...

CodeIgniter Model / Controller and UserID

My Models in CodeIgniter need to check that a user is authorised to perform the given action. Inside the Models I have been referencing using $this->session->userdata['user_id']. My question is - should I be setting a variable to $this->session->userdata['user_id'] in the Controller and passing this to the Model, or simply checking it i...

Setting custom toolbarset of FCKeditor in CodeIgniter

hi guys, I really need Ur help here I’m using fckEditor 2.6.5 with CI 1.7.2 I used this steps to pluged it into my project : http://codeigniter.com/forums/viewthread/107642/ I want to ask, how to set custom toolbarset in fckeditor??? some of articles said to doing that is by editing fckconfig.js with adding new custom toolbarset over th...

How should I handle uploads centrally and sanely in my web app?

Hi, I am creating a web application, which is basically a very specialised CMS. It's written in PHP with Codeigniter (though the specifics are not important) and is structure according to the MVC pattern. Many entities in this webapp require the ability to have uploads, e.g pages, articles etc. I have an upload controller which works...

CraigsList Auto-posting

I have searched high and low and have not been able to find a definite answer to this question. Does anyone know how developers auto-post to CraigsList using PHP (or CodeIgniter)? ...

Codeigniter - PHP Not Being Rendered In Views w/ mod_php 5

I recently transferred one of my websites to a private server which allowed me to use mod_php 5 along with XCache. However, when I switch from PHP 5 CGI to mod_php, the PHP that is directly in my view files is not being rendered. For example, the title of my page is “”. As in you can see the unprocessed code in the HTML. Any ideas as to ...

Trouble changing databases for my models in codeigniter

Hey SO, I'm making a website with two different databases. Let's say one is DB1, and the other is DB2. I've set up my database.php in the config folder, so they each have the correct host/password/username/database etc with db['DB1']['hostname'] and the other db['DB2']['hostname'] etc, so I'm pretty sure I've got that part right. Acc...

CodeIgniter's Input Class

Hello, Can i use codeigniter's input class to xss clean GET data like this: $somevar = $this->input->xss_clean($_GET['somevar']); CodeIgniter's suggest that xss_clean method should be used for the submitted data. I wonder whether $_GET vars are submitted or just visiting a URL. So can i use it in that fashion? ...

Query from to date with php in mysql

Hello. I have a date field in a mysql table formatted like this: Y-m-d. I want to export every post that has a date between $fromDate and all the way to $toDate I am sure its easy but now i am totaly blocked from ideas. I am using codeigniter if that helps. Best Regards Audun ...

MySql PHP results.

Hi i'm working on some code with mysql and need to display the mysql results with php.. MySQL select distinct(year(Cataloged_Date)) from records; +------------------------+ | (year(Cataloged_Date)) | +------------------------+ | 2009 | +------------------------+ 1 row in set (0.00 sec) PHP foreach($query->result() ...

Multi Part Form with AJAX in php/codeigniter

I am trying to create a multi page listing form (using AJAX - jquery) for a real estate site. The basic premise is that a user should be able to create a listing in step 1 of the form. In step 2 of the form, the user should now be able to upload images/video. In step 3 of the form, the user would add any additional information related to...

CodeIgniter, newbie questions

Hi, I want to program in the CodeIgniter few domain and 2 admins under a linux machine. one.com two.com three.com ....com and in addition to i need two backend systems. reports cms only few things are similar between the domains. and can be shared what is the best folder structures for that? after you suggest your structure, how do...

Last.fm or Spotify API

Hello, I was hoping someone could offer me advice, Im looking to build a website, and was hoping that I could inergrate my last.fm radio station or my spotify account into it so the users can listen to what I am. I know there are API's for each but do any of them support listening to music, nothing seems conclusive in there documentati...

Getting an error when trying to load a model

I'm loading a model for my CodeIgniter based website, but it keeps giving an error: "Fatal error: Call to a member function on a non-object in /nfs/c02/h05/mnt/30796/domains/planetchustar.com/html/arguit/system/application/controllers/home.php on line 8" Here's the part of code its referencing: function index() { $this->load-...

Trouble with Codeigniter Routes involving a query

Hey SO, I'm having a little trouble with a CodeIgniter route when there is a query (stuff after the ?) in the URI. I know it is good practice to replace queries with routes in CI, but I'm importing in a premade messageboard that already does everything with queries. This is my route: $route['messageboard/:any'] = "messageboard/index"...

CodeIgnitor, Jquery and Ajax help

I am currently building a website in codeigniter that is one page site, basically one the user comes to the page, they created with a main menu from that menu they choose which sections of the sites they would like to see, and clicks on the associated links...clicking on these links should display the content in their own accordian menu....

How to pass an array plus variables to a function in PHP?

Hi, I have a function prototype as such: function do_upload( $file, $id, $type ) And I'm calling the function like this: $this->do_upload( $files, $id, 'article' ); However, only $files is actually being passed through to the function. I'm sure it's simple but what have I done wrong? EDIT: So $file is just an array of file inf...

How do I set a header() and echo an image using CodeIgniter?

Hi, I've written a method to set a header() to the appropriate file type of an upload stored in a database and then I would like to echo() the file. The method is as follows inside a controller: function view_upload( $id = 0 ) { $id = $this->db->escape( $id ); $query = $this->db->query( "SELECT file_type FROM media WHERE id ...

Problem with my Jquery loading in my Codeigniter views

Hello, I am working on a one page website that allows the users to add and remove pages from there navigation as and when they would like too, the way it works is that if the click 'Blog' on the main nav a 'Blog' section should appear on the page, if they then click 'News' the 'News' section should also be visible, however the way I ha...