codeigniter

How can I have Code Igniter URI segments for multiple variables?

I'm writing an app that allows you to filter database results based on Location and Category. If someone was to search for Liverpool under the Golf category the URI would be /index.php/search/Liverpool/Golf. Should someone want to search by Location but not category, they would be sent to /index.php/search/Liverpool However, should so...

Codeigniter Unit-testing models

I'm new to unit-testing, so this is maybe a little dumb question. Imagine, we have a simple model method. public function get_all_users($uid = false, $params = array()){ $users = array(); if(empty($uid) && empty($params)){return $users;} $this->db->from('users u'); if($uid){ $this->db->where('u.id',(int)$id); ...

CodeIgniter: A Class/Library to help get meta tags from a web page?

Hello all, I am using codeigniter. I guess it doesn't matter which php framework I am using. But before I write my own class is there another that has already been written that allows a user to get the page title and meta tags (keywords, descriptions) of any sit...if they have any. Any sort of PHP class that does that would be great. ...

PHP, Codeigniter: How to Set Date/Time based on users timezone/location globally in a web app?

Hello all, I have just realised if I add a particular record to my MySQL database - it will have a date/time of the server and not the particular user and where they are located which means my search function by date is useless! As they will not be able to search by when they have added it in their timezone rather when it was added in t...

How to process a form with CodeIgniter

I am new to CodeIgniter. I need to process a form. I have a form.html page in view <html> <head> <title>Search</title> </head> <body> <form action="search"> <input type="text" name="search" value="" size="50" /> <div> <input type="submit" value="Submit" /> </div> </form> </body> </html> a...

open a url feed in codeigniter

What's the best way to open a URL feed in codeigniter? I'm assuming I can't put the URL in a file upload input, so should I use a normal text input and then validate that the URL is not malicious? If so, what validation tests should I perform on the user inputted string? Would checking the file extension be enough or can this easily be m...

Help in designing simple 2 table database?

Trying to create a simple 2 table database that lists the contents of various firewire drives, one table with FW number, the other with a file item on that drive number. eg. fw 233 file -> mike's home movie.mov I'm very new and can create single tables with queries, but haven't understood querying multiple tables with join. each d...

How to run a CodeIgniter file through CRON?

I've tried the following method in the past: <?php set_time_limit(0); $_SERVER['PATH_INFO'] = 'cron/controller/index'; $_SERVER['REQUEST_URI'] = 'cron/controller/index'; require_once('index.php'); ?> and putting this in a file in the codeigniter installation directory, calling it cron.php, and then invoking it via: php /home/[usernam...

DataMapper and Codeigniter - how to fully manage a many-to-many relationship

I have the following relationship CType has many Field Field has many Ctype and of course the tables used are fields, ctypes, and ctypes_fields. Normally, the ctypes_fields table should contain only ids referencing the other two tables. However, i'd like to put there a "options" field that will contain some content for the concrete in...

How do I direct to www.whatever.com using CodeIgniter's "anchor" function?

I'm using CodeIgniter (because it's awesome) and I have something like: <?php echo anchor("/", "whatever.com" ); ?> However, this results in http://www.whatever.com/.html which is not right. Help? ...

Performance gain or less using an association table even when there is just a one-to-many relationship

I am going to build a PHP web application and have already decided to use Codeigniter + DataMapper (OverZealous edition). I have discovered that DataMapper (OverZealous edition) requires the use of an extra association table even when there is actually just a one-to-many relationship. For example, a country can have many players but a ...

How to remove index.php in Codeigniter

How to remove index.php in codeigniter on Windows 7 and IIS. I searched net for the solution but result weree based on re-write module of Apache, if anyone has worked on IIS and Windows 7 and had similar situation pls help on this. I want to work on IIS and Windows 7 and if I can remove index.php while calling any particular controller...

How to efficiently sql query child records from multiple tables?

We have a simple database. The User table holds users. The Accounts table holds multiple accounts for each user. The Topics table holds multiple topics for each account. So, a user would have multiple accounts and each account would have multiple topics. So, if I have a user with id=1 how do I efficiently query all 3 tables to get all t...

how to get the value of form input box in codeigniter

value of FORM INPUT Help!! //this is just a refrence of $nm and $fid from test_model// $data['fid']['value'] = 0; $data['nm'] = array('name'=>'fname', 'id'=>'id'); say i have one form_view with <?=form_label('Insert Your Name :')?> <?=form_input($nm)?> and a function to get single row function get($id...

Aptana and CodeIgniter

Hi folks. I've just installed Aptana 2.0, and I'm trying to get Code Assist for Codeigniter. I've never used an IDE before, always stick with my good ol' E-text (Windows version for TextMate). But in every screencast about CodeIgniter, people use Aptana and get benefits of it's awesome Code Assist. So...any tips for setting it up?? Tha...

CodeIgniter Error - Undefined property: CI_Input::$post

I'm new to CodeIgniter and am trying to use the conditional below to determine whether or not the form has been submitted, and then display a certain view if it has. I got the error in the title for some reason and have been troubleshooting the problem for more than half and hour. Does anybody know how I might go about solving this probl...

Thinking logically about a database structure: Adding 'tags' to things users post - A seperate table or...?

Hi everyone! I'm still beginning to get my head around this whole relational-database-thingymawhatsit. Anyway, I'm a PHP programmer so I can do all that shabang. I just need to think what would be the best method for this scenario... I'm developing a site (with CodeIgniter if that's any help) - a site where users can post content (thi...

Multi-tiered MySQL query?

I have two tables(entries and tags) with a many-to-many linking table. Right now, I'm making a query to retrieve all the entries that meet my criteria, and a query for each entry to retrieve the tags. Would there be a way to say, have the tags returned through a new column as an array in the first query? ...

code igniter captcha not working

Hi code igniter captcha is not working in my page.My php gd library enabled but no change result ...

How can I redirect a 404 Error in a custom 404 page using Codeigniter?

Kind sirs, I'm using Codeigniter to build a blog. I might need a way to redirect a 404 error into a custom 404 page. Just like what Abduzeedo.com's 404 page. Is it possible to control this by using routes? Or should i use controllers to direct it to another view? Thanks very much! ...