codeigniter

CodeIgniter PHP Mail Function Not Working

I have a script which sends an email to myself from a contact page: if($_POST["submit"] == "Send Message") { $to = "[email protected]"; $subject = "Message received from Contact Us"; $message = "Email: ".$_POST["email"]."<br>"; $message .= "Name: ".$_POST["name"]."<br>"; $message .= "Message: ".$_POST["message"]."<br>";...

filter a string to remove disallowed characters to compose an URL in CodeIgniter

Hello I'm trying to make URL-friendly links for the blog on my portfolio. So I would like to obtain links something like site/journal/post/{title} Obviously Journal is my controller, but let's say my title would be 'mysite.com goes live!' I would like to have a valid url like site/journal/post/mysitecom-goes-live where all disallowed c...

CodeIgniter and Doctrine: Base table or view not found

I'm following the documentation almost word for word, except for two adjustments which I believe are corrections. First adjustment: I eliminate the redundant DIRECTORY_SEPARATOR in system/application/doctrine.php: //this produces "...system/application//fixtures" $config = array('data_fixtures_path' => dirname(__FILE__) . DIRECTORY_S...

Multiple Application Instances with Codeigniter

How would I go about creating an Codeigniter application that resides on multiple servers and has a hook that sends users to different instances based on the load balance? ...

Codeigniter database issue

Hello chaps, Having a spot of bother trying to grab some data out of my database. I have the following model: function GetRestaurants($options = array()) { // Qualification if(isset($options['restaurantID'])) $this->db->where('restaurantID', $options['restaurantID']); if(isset($options['restaura...

How can I call a controller method in a view or another controller?

I have main controller, that print main page. <? class Main extends Controller { function Main() { parent::Controller(); $this -> load -> helper('date'); } function index() { $this -> load -> view('header'); $this -> load -> view('main'); $this -> load -> view('footer'); ...

Url Segment but for Searching

The Url Segment in Codeigniter seems simple and easy to follow... however, I am creating a search feature which requires the Url Segment to be dynamic. If I add a Search function within my Main Class, I would have to include the "Welcome" class to the Url Address: http://example.com/index.php/welcome/search/stuff-i-want-to-search/ Howe...

Codeigniter form validation

Im using codeigniter validation class when submit forms. Also Im using set_value() to re-populate fields on form fails. If I have $this->form_validation->set_rules('name', 'Name', 'required') set_value() works and field is re-populated. But what if I dont wont the field to be required ? If I do not add $this->form_validation* re-pop...

jQuery multiple image uploader insert in to database?

I’m currently using jQuery’s Multiple image uploader for my form in CI. This works superbly however I would like to insert the file names, etc in to the database - anybody any ideas how I can do this? My controller $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|pdf|doc|bmp|png'; $config['max_size'] = ...

Filter database results without running an additional query

I'm using CodeIgniter for a classifieds website. Here's a specific example of what I'm trying to achieve: On page http://www.example.com/browse/Real-Estate all the Real Estate classifieds are listed. I'm using CI's Pagination Class to paginate the results. On the leftbar, a set of filters are shown that correspond to each db column of ...

CodeIgniter app shows 404 when moved to production

Hi, I've finished developing an app using CodeIgniter in my local machine, and moved it to the production server (live site) yesterday. My problem is that when I load the site, it immediately shows me a "page not found" error (404). I'm 100% sure this has nothing to do with the server itself, since a clean CodeIgniter installation work...

Use query strings with Pagination Class in Codeigniter

Is it possible to append query strings to the links created by the pagination class? Currently if you are on this page: http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes?price_low=19&amp;price_high=300 the links are incorrectly generated as http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes&amp;per_page=20 http://127.0.0.1/~pa...

external libraries in codeigniter

I have my directory structure set up as follows: -application --controllers --models --libraries --views --etc -library --codeigniter_1_7_2 --codeigniter_1_7_1 -public_html --images --scripts This has worked well for me, and I like having the codeigniter "master" files off in their own library. A quick switch in the index.php file and...

CodeIgniter + Doctrine: CRUD in Controller?

Hi all, I am a newbie to MVC, CodeIgniter and Doctrine, so maybe my question is not that relevant. Pardon me if thats the case. I've been reading the CodeIgniter + Doctrine tutorials on PHPandStuff.com. I really like whatever I have seen of Doctrine and wish to use it for my project. However, since all database related operations shoul...

beforFilter in codeIgniter

What is the best way to do and equivalent to CakePHP's beforeFilter() in codeIgniter ...

Resizing Images with Codeigniter

Hey :) I want to resize an image when I address it in a form(save to database). I dont think it will be a problem [pointing to the image etc, however the space I am going display the thumb in is 228 x 228. I know I can maintain the ratio and determine the size in the controller, yet how is it done on images that are frequently differe...

Calling a view "mid-script" with Codeigniter...can it be done?

I'm using the Codeigniter framework and have tried to stick with the MVC philosophy as best I can. I've recently run into an issue that I'm not entirely sure how to handle. I have a PHP script running that takes a fairly long time (creating an index for my search engine). What I want to do is have the html show up as it's running. If ...

Codeigniter is "catching" url charcters even though they've been urlencoded

I'm having the strangest issue with codeigniter. I have a site that has a search feature which displays the person's query in the url so that they can save the url. I make sure that the query text has gone through rawurlencode before I stick it in the url. However, Codeigniter still shoots me to an error page when there's a character i...

check existence of variable in view via code igniter

In Codeigniter I want to know the best practice for using the same views with various functions in a controller. For eg in the index function I have $locals['somevar'] = "some thing"; $this->load->view('welcome_message', $locals); in my view I have something a bit like this: <?php if($somevar):?> <?=$somevar?>...

What CodeIgniter template library is best?

Hello, As I see, there's a few Codeigniter template engines scattered all over the web, but unfortunately I can't recognize which is better in regard to: performance, features, maintenance ..etc Some of those I've reached and seems to be mature: Ocular-Template-Library http://github.com/lonnieezell/Ocular-Template-Library Template Lib...