codeigniter

Mod Rewrite Newbie in CodeIgniter

I'm pretty new to mod-rewrites, and I'm having trouble getting this right: I'd like http://myurl.com/special and http://www.myurl.com/special to both redirect to http://myurl/index.php/special without changing the url for the visitor in their browser. currently, my .htaccess looks like this, to remove www from URLs <IfModule mod_rewri...

Passing an object between two controllers

Hi, I have two controllers , and I have one object. I want to pass that object between my two controllers in CodeIgniter. There is a registry or something like that?? Example - I am using ipbwi (for invision power board 3.1 integration ) , on my main controller I am doing this - private $ipbwi; function Main() { parent::Cont...

PHP: Codeigniter style-url:s?

Hi everybody, I am looking for some help on how to create the sort of URL-rewriting CodeIgniter features for my own PHP pet application. I know that the .htaccess-file does one part of the magic, but how does a PHP file looks that handles the URL splitting and calling of controllers/methods accordingly to the URI? Thanks a lot for yo...

Codeigniter: Problem after migration!

I just transferred my local web app to my server, and now I'm getting this error: Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /nfs/c05/h01/mnt/71658/domains/ergo-metric.com/html/application/libraries/Survey_form_processing.php on line 172 This is odd because it works locally! I changed my db settings to the pr...

Using Email Class in Codeigniter (Advanced Way)

I want to send emails using Email Class(CodeIgniter) Problem is that Email is sending so simple in text format... I want to design email with (html, tables and colors) or What is the advanced-way for Emailing with CodeIgniter. ...

Codeigniter HVMC modular seperation extension URL rewrite / routing

Hey Guys, Ive been using HVMC modular extension, and its working great, but Im having trouble figuring out how to use, and if it is possible to use URL routing with HVMC. Basically, I have a module called “site”, which is my main default site controller. All of the other modules I am not using directly, I am only using them by calling ...

Jquery delete content via AJAX

Hi All, I have a PHP application, which has a delete function on one of the pages. I am allowing user to delete a tag from their profile, by clicking on the tag. Once the user clicks the tag, the content area in the HTML which previous displayed the tags, gets updated with the new set of tags. Now the problem is, from the list of tags,...

problem with session in codeigniter

hi . i have this code in my controller class Upload_center extends Controller { function __construct() { parent::Controller(); $this->load->model('auth_model') ; if(!$this->auth_model->authorize()) { redirect('login'); } } and i have this code in my view $('#swfu...

Write an array to config in Codeigniter?

I'm working with a config file that I have create in order to store users. This surely wasn't what the configs were intended to be used for, but it's an extremely small application and I think that it would be a nice solution. My array looks like this: $config['users'] = array(array('username' => 'username', 'password' => 'password'));...

URL Rewriting Problem for a Beginner

I'd like to have all requests to http://example.com/controller redirected to http://example.com/index.php/controller without changing the url, and this is what my .htaccess file looks like: # Customized error messages. ErrorDocument 404 /index.php # Set the default handler. DirectoryIndex index.php # Various rewrite rules. <IfModule m...

Codeigniter not finding the controller

This is my basic file structure /system - /application - /config - - -routes.php - /controllers - - -about.php - - -home.php - - /admin - - - -dashboard.php - - - -login.php - - - -news.php And in routes: $route['admin'] = 'admin/dashboard'; //This should be the default. $route['admin/(:any)'] = 'admin/$1'; Browsing to http:...

enable the query string in codeigniter

i already make two changes in config file to enable the $_GET array as $config['uri_protocol'] = "PATH_INFO"; $config['enable_query_strings'] = true; but whenever i try tow run my code as http://example.com/controller/function/$demo=demo it redirected towards the default controller ...

PHP Framework Overhead

There are tons of PHP frameworks out there; some are pretty decent, others seem bloated and unnecessary. After watching Rasmus Lerdorf's presentation on PHP performance at Digg, I'm somewhat more concerned about the performance of the frameworks that I choose for building my applications with. Two of the most popular frameworks that I'm...

preg_replace with views in Codeigniter, how?

I'm trying to parse a view with BBCode, and it works fine. But there is one feature I don't know how to implement. [box=test] should be replaced with $this->load->view('admin/news/test', '', true); This is my code so far: $CI =& get_instance(); $view = preg_replace("'\[box=(.*?)\]'i", "\\1", $str); The thing here is that \1 will be...

'created at' and 'updated at' fields

This seems like a really simple one but I'm struggling to figure it out. I want a column in my database that lists when a record was first created and another column that says when it was updated. It's my understanding I should be able to do all this just using MySQL. All help is appreciated :) This stinks still no answer, reasons I'm a...

Why I'm getting "cannot modify header information headers already sent by registration_model" error in codeigniter?

Hi there. I have a problem with model in my codeigniter app. I'm getting this error of sending headers information. Basically, codeigniter is complaining about my registration model sending header information before anything else. How is it possible? I thought that models are only for holding db queries methods and nothing more. Can some...

How can I read a QueryString in CodeIgniter?

I know it's been asked before, but I need it for affiliate tracking... http://www.mysite.com/controller/method/params?affiliate=123&amp;sub_id=456 How can I get the params AND the $_GET parameters outlined in that URL? ...

no idea why my model returns two different values

This is my view all function in my postcards model, in one controller it returns 4 and the other returns, no idea why, I'm echoing num_rows() to see whats going on. Theres nothing else being passed, its exactly the same except, one view is a front for a facebook and one view is an admin section function view_all(){ $query = $this-...

OO PHP Class method renamed to variables?

Hello fellow PHP geeks, I'm sort of in a weird situation... One of which I've never come into before (It's maybe due to my break from PHP to .Net). Using the framework CodeIgniter. Well here's the situation... I've got a User class which acts as the user object containing username/password/email etc... (shown below): <?php if ( ! def...

Sphinx wildcard searching won't work

I have used the following code: function searchSphinx2($tofind,$jobtype_id,$payper_id,$onetimeBounds) { $this->load->library('session'); $this->load->library('sphinxclient'); global $result; global $functionresult; $functionresult=array(); $this->sphinxclient->setServer('localhost'...