codeigniter

How can I redirect multiple URLs to a single URL for the homepage?

I have a site built on codeigniter but I have come accross a small issue. Basically the homepage can be accessed through 3 different urls, being: www.domain.com/en www.domain.com/en/ www.domain.com/en/home.html I'd like the first and third url to redirect to the second (www.domain.com/en/). I've been playing around with .htaccess fo...

Get timezone name in codeigniter

I use the date helper in CI to save the timezone of the user when he signup eg: UM45. I want to set the timezone of each user based on that and display the date time correspondingly, using date_default_timezone_set(). But that accepts only string.. How can I get the name of the timezone based on UM45? ...

Changing Form Action Location in CodeIgniter

I am writing a web application using Codeigniter for a client and am using one of their internal development machines. Due to security restrictions the web server port is only internal and not exposed to the outside world so I must access it over a SSH tunnel. So I hit the web server like this: http://localhost/path_to_data. I am creati...

Removing users' personal information from message posts in php.

I have implemented a php/codeigniter messaging system and want to prevent users from posting their phone numbers, addresses, e-mails, websites or anything else that might allow for user contact outside of our messaging system. Does anyone know of any available plugins or code that would remove such personal information from text? Tha...

CodeIgniter Active Record, basic update give error

Hey, I'm new to CodeIgniter and I get an error I cannot understand. This is the code that give the error: $data = array('adr' => $address); $this->db->where('id', $id); $this->db->update('domains', $data); The error is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the rig...

Updating mysql bit datatype using codeigniter active record

Hi, I have a table with one columns datatype as BIT(1) . I am using active record of codeigniter for performing queries. But the setting of bit is not working. Does anybody has idea about how to do it? Or I have to get back to normal query? Following is the code snippet: function itemUpdate($options=array()) { if(isset($options['isA...

stored procedure mysql

I have a database call that i am not sure if i am doing it the most efficient way. Basically the call queries a table of events with zip codes and then joins a zip code database that gives the lat/lon of that events zip. Then it joins the logged in user to the query and that user has a lat/lon of upon logging in. So the whole query pu...

retrieving data from DB oop

I'm using the codeigniter framework, I'm retrieving data from the database in the form of an array but when i try to use the foreach function to display the data i get an error Message: Object of class stdClass could not be converted to string this is the array Array ( [0] => stdClass Object ( [id] => 1 [...

Building my first API for a CodeIgniter app. Any tips?

Hi, I'm planning on building a private API for a CodeIgniter web application I have. I've found a tutorial for that which shows me how to do it using pre-built libraries. I'm very new to this so my questions is: shall I use and rely on these libraries? or shall I learn how to build it from scratch in order to have complete control over...

htaccess and mod_rewrite codeigniter

I am using codeigniter and below is my htaccess file. However, i want a single directory to be accessable outside of the codeigniter app via my domain.com/directory. the other directory is a forum not related to codeigniter. how would i set up a rule in htaccess? i dont have access to http.conf <IfModule mod_rewrite.c> Rewri...

Is there a difference from having codeigniter send via smtp to gmail versus sending via sendmail when our mx records point to google?

Currently were getting considered spam and we need to figure out what is the best soulution. Should we be using sendmail or sending via smtp directly to google? ...

What is a ABSTRACT CLASS and INTERFACE and when would you use them in PHP?

What is a abstract class and interface in PHP and when would you use them? A layman answer with an example would be great to aid my understanding. Thank you in advance ;-) ...

nginx and codeigniter (telling a server to put all traffic through index.php?)

Basically, the htaccess I use with apache says something like "if the requested file or directory does not exist, route the request through index.php" How exactly can I do this with nginx? That way, if a stylesheet is requested, it's served. But if the url isn't to a file on disk, then it should run the framework. ...

is there a way to get codeigniter to create a plain text page where \n char works properly?

I am trying to use vanilla forum with proxyconnect and it requires i give it a plain text file of my user's authentication cookie values in the form below. However, when i send it the only way i can get it to work is with the tags and i needs to have the \n tag. document should be: UniqueID=5 Name=Kyle [email protected] I can g...

IE doesn't send POST data

IE 6 and any other version of IE stopped sending POST data since some undefined moment in the past. Reinstalling doesn't help. xdebug shows empty $_POST, profiler echoes empty array. FF and Opera work fine on the same PC at the same time. Case is WinXP, IE6, IE8, CodeIgniter 1.7.2, Apache 2, PHP 5.2.4 ...

what is db_clean in codeigniter?

tel me the use of db_clean() with the simple example... thanks in advance. ...

Codeigniter - best routes configuration for CMS?

I would like to create a custom CMS within Codeigniter, and I need a mechanism to route general pages to a default controller - for instance: mydomain.com/about mydomain.com/services/maintenance These would be routed through my pagehandler controller. The default routing behaviour in Codeigniter is of course to route to a matching con...

Converting a Mysql Result Object to Associative Array (CodeIgniter)

Hello, I'm trying to get a database query which is an object converted to an associative array, so that I can use it in the calendar class in codeigniter. This is my model: <?php class Get_diary_model extends Model { function getAllDiaries($year,$month) { $data = $this->db->query("SELECT day AND entry FROM diary WHERE m...

How do I add some static routes to a CodeIgniter app?

How do I configure a CodeIgniter app so I can have one directory that will just serve some static (not MVC) html? I want to handle some existing links, in the form of: http://mysite/contactform/contact.html?queryvars Anything in the /contactform directory including sub-directories (which is just some css, js, images,etc) should not go...

Using modx (content management) with a php framework

I like CodeIgniter for php development, but I have a client with no tech skills that wants to make his own changes to his site. I taught him how to make pages in MODx (that was a feat in itself). Is it possible to develop a site with CodeIgniter and use MODx as the content management system? Will MODx mangle the framework? ...