codeigniter

Templates in PHP, and the best way to notify the application that one exists?

I'm using CodeIgniter, and will likely use their template library, as I want to keep things extremely simple and easy to use. The content for the template variables will come from the database, but I want the business admins to know what content areas are available (basically the names of the variables) when they choose a specific templa...

Unit testing a web site

I'm curious to see how other developers go about testing their web sites (PHP specifically in my case, but this probably spans multiple languages)? I've been working on a site for over a year now and I'd really like to automate a lot of the regression testing I do between versions. This specific site is in code igniter, an MVC framewor...

CakePHP vs. Codeigniter

I'm new to both platform and my main decision factor is : Which one of the two will help me create and finish my first website(s) quicker? By that I mean - Better set of helpers, responsive and friendly support from the community, easier to find snippets. Integration with jQuery, available ready themes and code samples, better document...

PHP: Fatal error: Allowed memory size of 134217728 bytes exhausted (CodeIgniter + XML-RPC)

Hello, I currently have a set-up that goes as such: I have a bunch of "client" point of sale systems that periodically send new sales data to one centralized "HQ", which stores the data into one big database for report generation. The client POS is based on PHPPOS, and I have implemented a module that uses the standard XML-RPC library ...

CodeIgniter Install Problem

Hi All, I'm having a problem getting CodeIgniter to work on my shared hosting account. The URL is http://test.tallgreentree.com. It's not giving me a .php error, but it is displaying a 404 page for everything I type into the address bar. Here's the beginning of my config.php file. <?php if ( ! defined('BASEPATH')) exit('No direct s...

How would I generate / parse this RESTful url in codeigniter

I'm new to MVC, being RESTful, and CodeIgniter and I'm trying to get into it in my spare time, so this is largely an academic question. I'm trying to build a url that will display the availability of a particular hotel room, for a particular hotel. I figured the RESTful way to do this would be http://url/Hotel/2/RoomAvailability/3/ ...

Getting CodeIgniter HelloWorld example to work

Guys I'm a newbie to code igniter.. I do not understanding how to use this framework. Its just opening the user guide. Can anyone tell me the steps I need to follow to execute the "hello world" program on code igniter? ...

editing .htaccess file

I'm made a codeigniter app and I tried to use the apache mod_rewrite rules as RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] The problem is that I have this app in a folder abc/ but when I type mysite/abc/something (which should point to mysite/abc/index.php/somethin...

jquery: Auto-refreshing a div

I'm having trouble getting this div to automatically update using jquery - it's essentially a "chat" feature that would have the page refresh every 2 seconds. Here's the problematic jquery code - I've tried several variances of this with no luck, so completely rewriting it differently is more than welcomed. function updateChat() { ...

How to set form validation rules for CodeIgniter dynamically ?

With the new version of CodeIgniter you can only set rules in a static form_validation.php file. I need to analyze the posted info, i.e, only if they select a checkbox, only then do I want certain fields to be validated. What's the best way to do that? Or do I must use the old form validation class (which is deprecated now) ...

In CodeIgniter is it ok to use $this->load->model() as often as needed?

Basically I have lots of code in models and although the model might've been loaded elsewhere I like to make sure by doing $this->load->model() almost everywhere its used. Is that all right, or does it use up any resources even if the model has already been loaded? ...

Codeigniter Character Encoding Issues

Dear StackOverflow Community, I am running Codeigniter. I have a few simple pages which have no DB data, are just static loaded as following from the controller. I have set everything possible to UTF-8 - I have checked headers which result to UTF8 - however it still parses wrong (these characters: ���). function index(){ $this->l...

Securing a PHP file manager from its users

Hello everyone, I'm developing a photo sharing web site using the CodeIgniter PHP framework. The idea is that people could upload their photos, manage them (through some sort of file browser which allows them to create subfolders, drag files around, etc) and edit them (some basic things like resizing, rotating and cropping to start with,...

CodeIgniter - multiple instances of a model

I am using CodeIginter as my PHP framework. I am explaining the situation below: - I need three models named: - User_Model Relation_Model Reminder_Model Now consider the situation: User_Model is already written. I am writing Relation_Model. My friend will write the Reminder_Model. Relation_Model instantiates User_Model, and uses t...

Codeigniter Multiple Databases

I'm using in my database.php $db['default']['hostname'] = "192.168.2.104"; $db['default']['username'] = "webuser"; $db['default']['password'] = "----"; $db['default']['database'] = "vad"; $db['default']['dbdriver'] = "mysql"; $db['default']['dbprefix'] = ""; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['def...

PHP install script - Codeigniter

Hi all, I have an application developed with codeIgniter that I would like to write a nice user friendly install script for. The biggest problem with this is that code-igniter needs configuration manually before this can happen, does anyone know a way around this / the the best way to allow this with minimal configuration? ...

Codeigniter: How to do a select (distinct fieldname) MySQL query

I'm trying to retrieve a count of all unique values in a field. Example SQL: SELECT count(distinct accessid) FROM (`accesslog`) WHERE record = '123' How can I do this kind of query in CodeIgniter? I know I can use $this->db->query() and write my own SQL, but I have other requirements that I want to use $this->db->where() for, and if...

Asynch page call from a bookmarklet with CodeIgniter

I'm trying to make a bookmarklet that will take the url of the current page you are on and send it to an application written in PHP with CodeIgniter. The problem I keep running into, however, is that I can do a standard AJAX call because it's cross-domain so it's disallowed and I can't figure out a way to use the JSONP via GET method, s...

Zend Framework Lucene Boolean / "Google"-like search

I'm working on the application at http://demos.zatechcorp.com/codeigniter/ In its current incarnation running on my machine, I loaded the ZendFramework inside Codeigniter, and generated an index, like this: // ... Some code that loads all the markets foreach ($markets as $market) { $doc = new Zend_Search_Lucene_Docu...

Codeigniter security - mysql database

I'm in the final stages of implementing a codeigniter site which requires a really simple login system: one user and one password, to protect the admin area. I think I will be using one of the many CI authentication libraries, which should allow me to ensure that people can't read from the database without being logged in as admin(I hop...