codeigniter

CodeIgniter Active Record - Get number of returned rows

I'm very new to CodeIgniter and Active Record in particular, I know how to do this well in normal SQL but I'm trying to learn. How can I select some data from one of my tables, and then count how many rows are returned using CodeIgniters Active Record class? Thanks, Tom. ...

When running phpdoc on a CodeIgniter project, which folders should be included?

On my first try, I've only included system/application/models, system/application/controllers, system/application/helpers, and system/application/libraries. I chose those folders because I think those folders contain the code that you want to be properly documented for future reference. What other folders do you think should be included...

making un-visible a specific part of url generated by javascript + codeigniter

Hi friends, http://www.blabla.com/our_work/client/client-name#/uploads/18.jpg I use CodeIgniter, and this is the url I have. I use a gallery script at the page, and it generates #/uploads/18.jpg such thing at url :( is there any way to make it unvisible or sth . maybe with htaccess. i dont know. i dont want to spend an another day ...

Codeigniter / image_lib forcing image size

Hi, I am resizing images using the image_lib library. I define a height and width, but most of the images I am trying to resize are already smaller. Is there a way to force the size and fill the rest with white, thus making all my images the same size? Thanks $config['source_image'] = 'abc.jpg'; $config['new_image'] = 'def.jpg'; $con...

Best Practice PHP MVC Question...

I'm creating a calendar application in PHP with CodeIgniter. In the main calendar page, My model currently creates an array with each index being one day on the current month. That day is an array containing any events the user may have on that day. Now, should I construct the calendar array in the controller FIRST, then pass it to the ...

__construct() { issue for PHP4 and PHP5. maybe an another reason...

Hi friends, I have weird issue with CodeIgniter, here is a start part of my controller class Home extends Controller { /** * Constructor */ public function __construct() { parent::Controller(); } ... everything is working fine at localhost, but when I try same at server, I come cross with an error like b...

syntax error at server for the code works fine at localhost... it is weird! :/

Hi friends, I have an interesting issue :/ I use CodeIgniter and the code below is working fine at my localhost, but when I upload to server I come cross with an error message like Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home3/blabla/public_html/blablabla/applications/frontend/models/our_work_model.php on ...

Codeigniter & PHP - forcing a 404?

In codeigniter, as you know, a page of the form: /class/function/ID, where class is the controller name, function is the method within the controller, and ID is the parameter to pass to that method. The typical usage would be (for a book site for example) to pass the book id to the function which would then query the database for approp...

Problem when removing index.php from url

hi friends, dont worry it is not an another how to remove index.php from url question!! :D i researched and made according to tutorials; here is my source http://codeigniter.com/wiki/mod_rewrite/ im sure about all steps, but when run it, i dont see any error message… url changes like www.blablabla.com/contact www.blablabla.com/about...

SQL and CodeIgniter

Hello All. I currently am creating a book inventory system with CodeIgniter (am new to CodeIgniter) and I would like each of the books to have to have tags. Currently, I have 4 tables: Books Tags BooksTags (matches bookid to tagid) Collections (series collection) In the controller for the main view which will show all the books, I ...

How to have a default option selected in a dynamic pull down menu?

I have a drop down menu that I am dynamically populating based on values in a database table. The code looks something like this: <select> <option value="" selected="selected">Select Option</option> <?php foreach($var as $row): ?> <option value="<?php echo $row->value;?>"><?php echo $row->value;?></option> <?php endforeach;?> </sel...

What is the best Authentication and Authorization library for CodeIgniter?

I intend building an application using CodeIgniter so I'm currently identifying all the features I want. I would like to know if there are any recommendations for Authentication & Authorization libraries for CodeIgniter. ...

How to integrate Wordpress template with CodeIgniter

How can CodeIgniter and Wordpress be integrated such that the look and feel/template of the Wordpress blog is carried over to the CodeIgniter-created pages? ...

.htaccess redirecting errors

First off I am using the Codeigniter Framework so this issue is a workaround the way CI process URLs along with the current redirects I have set up using mod_rewrite. I am trying to get a URL like this /?gclid=somestringgoeshere to redirect to /index.php?/home/gclid/somestringgoeshere. The current .htaccess I have set is below <IfModu...

Programming first, framework second?

Firstly hello as my first question. Looking for guidance rather than coding fix. The final flicker of Informix 4gl contracting extingiushed for me in 2004. To cut a long story short I am looking to code again by creating a website. I will be using PHP v5 and MySQL. Spent about a year (in spare time) doing all data analysis and DB desig...

Safe timeout value for codeigniter session class?

I am using codeigniter's session class to handle my PHP sessions. One of the session variables automatically created on every visit to the site is session_id: The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes) ...

CodeIgniter: Development and Production Environment

Hello All. I am currently in the process of learning the CodeIgniter PHP framework. At the current moment, I am looking to have a DEV environment and a PRODUCTION environment. Coming from a purely C and JAVA background, I am used to having everything locally (with version control), but since I will have the PRODUCTION side on a website,...

How does codeigniter's form validation library handle xss filtering?

The codeigniter form validation library provides the option to 'prep' data from a form that is being validated. The following is a snippet from the documentation: $this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|xss_clean'); The xss_clean parameter at the end supposedly passes t...

Blank Screen with code igniter... help?!!!

Hi, I've just moved a site across to a production server, and a once working CI installation, now returns a blank screen. I believe it is due to whitespace, but how are you supposed to find something like that?!!! Hope someone can help. Thanks in advance. Tom ...

Is it possible to apply multiple string interpolation in labels for form_validation custom callback methods in CodeIgniter?

I'm not sure how I should phrase this, so pardon me for my lack of narrative.. Here's an approximate form of my current code, trimmed down to the essentials of the problem (PHP v5.2 / CodeIgniter v1.7): In system/application/config/form_validation.php, I have a rule that looks like this: 'some_controller/save' => array( array( ...