codeigniter

Codeigniter - handling errors when using active record

Hi There, I am putting together a few models for my codeigniter site and can't seem to find any word in the documentation of how to handle errors that could occur when using the Active Record system. The documentation demonstrates how to perform CRUD along with some relatively involved queries but no where along the line is error handli...

Facebook Application Using CodeIgniter

I am building a Facebook app using iframe rendering. I want to use CodeIgniter for the back end and am wondering what all the settings should be set to for CodeIgniter and Facebook to get along. Specific settings I am wondering about are: Facebook's canvas callback url (should it include the default controller and function)? config.php...

URI re-routing in codeigniter

I'm using URI re-routing in CI to make better URLS. An example here would be: $route['users/(:any)'] = "users/index/$1"; The aim here is to get rid of the index from URL. This works well. However it stops me from being able to access any functions in the users controller, for example mywebsite.com/users/messages Just redirects to t...

MySQL Query in CodeIgniter with Session ID

Hi all, Let's say I have a query: " SELECT * FROM table WHERE donor_id = " .$this->session->userdata('id') ." GROUP BY rating" However, it appears that I get a mysql syntax error here, citing that $this->session->userdata('id') gives me '25' for example, instead of 25. Are there any workarounds here to prevent $thi...

How to show javascript notification during a uploading an image/File???

Hello I have a upload box which is used to upload image. I want to restrict the user to upload a particular sized image. Such as, user can't upload a image which is larger than the allowed width, height. If someone tries to select such, then i want to show him a message on client side using javascript before uploading the image. So ca...

Codeigniter: unable to link the referencing css file

I am just starting out with Codeigniter. I have referenced the css file in the corresponding views file but it fails to link. This is the code I have used to reference the css file. <link rel="stylesheet" href="<?php echo base_url();?>css/style.css" type="text/css" media="screen"/> I tested the css code by inserting it between & a...

ruby on rails vs codeigniter

hi all... between ruby on rails and codeigniter, which framework is better (and why) for a website with user management profile pages subscriptions blog upload/download ...

CodeIgniter Validation Callback not being Called

Hi all, My callback function from validation rules isn’t being called. The other validation rules for that field ARE being called $rules[‘login_name’] = “required|max_length[12]|alpha_dash|callback__check_login_name”; function _check_login_name($login_name) { echo "here"; // DOESNT WORK } So in the above line, required, max_...

Multilanguage URLs

In codeigniter, the name of your controller, reflects the URL. But my question is, how can you create multi language URLs without copy/pasting all your controllers. Example: In english the URL would be: http://www.example.com/order In dutch the URL would be: http://www.example.com/bestellen ("bestellen" is dutch for "order") Thanks...

Codeigniter language

Hi. I wanna make a multilanguage website, but I do not want that the language appear in URI like example.com/fr/about (I do not want this). I just want to change the text language. My problem is that the first load language that I do is for ever. why? If I do: $this->config->set_item(‘language’,‘english’); $this->lang->load(‘messages’);...

Codeigniter Join Database Problem

This is my model: function getGalleryListing() { $this->db->select('photo.id,photo.src,photo.title,photo.user_id,users.id,users.username'); $this->db->from('photo'); $this->db->join('users', 'users.id = photo.user_id'); $query = $this->db->get(); return $query->result(); } And my controller: function index...

Building URL in CodeIgniter

I'm basically trying to grab everything after the 4th segment in the URL, however there is no fixed number of segments. Here is my attempt but for some reason $url is always 0 rather than the string I am looking for. Any suggestions? $url = ''; for ($counter = 4; $counter <= $this->uri->total_segments(); $counter++) { $url += $this-...

Issues uploading CodeIgniter from localhost to website

Hi all, I've been developing a website locally with CodeIgniter and have tried uploading it to my web server and get the following error (which I've never seen until the upload). Fatal error: Class 'CI_Hooks' not found in <snip>/system/codeigniter/Common.php on line 136 I've read that CodeIgniter doesn't play nicely with PHP 5.3.x, e...

Can a project built using a framework under BSD license be released as GPL?

I am working on a project named Rosepad which is my vision of an Issue Tracking system. I know many people may call it "yet another foo", but it fulfills the void which I had witnessed. Now getting to the point, I am using CodeIgniter framework to build this web application. The framework itself is released under a permissive-style lice...

Codeigniter HMVC and CMS

I am using Codeigniter with the HMVC Modular extension and have a backend CMS area for managing website content. I am routing the base URL + "admin" (http://localhost/cms/admin) to controller methods with the prefix "admin_". e.g. function admin_index() {...} And here is my routing: $route['admin/([a-zA-Z]+)/(:any)'] = "$1/admin_$2...

CodeIgniter Image Manipulation (Resize & Watermark)

I'm hoping someone can help me. I'm trying to upload an image via a form, resize it to 600px, create a 100px thumbnail and then add a watermark image to the 600px version, but the code below is just creating two versions of the original image. $image = $this->upload->data(); $resized = base_url()."images/artwork/".$image['orig_name']; ...

Prevent direct access to files with .htaccess

Ok, I am using codeigniter and I have a secure login section. Inside the login users are able to download files. What I need to do is stop people been able to access the file directly. I figure there will be a way using .htaccess to check for a authenticated variable that I could set in the POST array or something similar. Any pointers...

how to receive the post value of dynamic text box

hi this is my forloop which has bulk number of data $a = 1; for($i = 0; $i < sizeof($StudName); $i++) { ?> <tr align="left"> <td class="table_label"><? echo $code[$i].' - '.$StudName[$i]; ?></td> <td><input type="text" name="mark1<?= $a ?>" id="mark1<?= $a ?>" ></td> <td><input type="text" name="mark2<?= $a ?>" id="mark2...

Port of Statpress to CodeIgniter

I was wondering if anyone has ported the wordpress plugin Statpress into a CI library. If they hadn't, would this be worthwhile doing? ...

CRON job for codeigniter

I am using codeigniter. I want to know how to set up a cron job to check a table for expiring users and insert data in to another table with the list of expiring users. How to do that. When i tried to write a script with controller and model to insert the table : Content-type: text/html Fatal error: Class 'Controller' not found in /h...