codeigniter

CodeIgniter callback in helper

How I can call my callback in a helper? If i create the callback in the controller works fine, but if I create it in a helper, CI does not call it automatically. ...

Dynamically adding HTML fields with Javascript and CodeIgniter

I've been having a lot of troubles with this for the past few hours right now and I'm really not seeing where the problem is. Every single code snippet I find on the Internet is telling me I'm doing it right, but for some reason, nothing is working. Basically, I have a form that requires fields to be dynamically added depending on the n...

htaccess (https to http)

Hi, this is yet another .htaccess question. And I already did my literature review. Would appreciate any help. Requirements: Force HTTPS only for a few URLs. Browser shouldn't say partially encrypted page for SSL pages. I am using CodeIgnitor and tweaked the *base_url* in config.php to: $config['base_url'] = (isset($_SERVER['HTTPS...

Plotting graph with FLOT using mysql and ajax

I am trying to use flot to plot some data that is pulled from a MySQL db. I am log users login visits and I have a SQL function that will retreive the number of visits per day for a given month, getStats($day). I have read some examples online how to properly do this but for some reason when I try and graph the array data in my javascrip...

One page Codeigniter site using jquery? ajax?

Hello, I am hoping for some advice, imagine if you will will you are on a website and you are greeted solely with navigation menu, on click the navigation menu that is situated within the left hand side of the screen you can add various content to the right side of the screen that is loaded in individual ‘divs’ then collapsed in accordi...

Why are CodeIgniter application files in the public_html folder?

Isn't having all of the files in public view a bad thing? Surely things such as /system/application/config/database.php should not be publicly visible! ...

Logging into a two different log file types in Codeigniter

Is it possible in CI (natively) to log into two different files from two different controllers? I haven't found such option in user manual nor any solution in Google. Is there any 3rd party logging library available for CI? ...

mySQL join question.

The following line is giving an error message. $query = 'SELECT * FROM products AS p LEFT JOIN categories AS c USING ON c.id = p.category_id WHERE c.name = "Galleri1" AND p.status = "active"' ; $Q = $this->db->query($query); Data base structure. CATEGORIES CREATE TABLE IF NOT EXISTS `categories` ( `id` int(11) NOT NULL AUTO_INCR...

How to include CodeIgniter generated pages?

What would be the easiest way to include a CI file? Let's say I want to include http://example.com/ci/index.php/mycontroller/ on example.com example.com doesn't run CI and I can't do include('ci/index.php/mycontroller'). ...

Getting dynamic HTML output from another page on a server (perhaps file_get_contents)

I'm using the MVC framework CodeIgniter for my work, if it's relevant. In one of my pages/controllers, I want to capture the HTML outputted by another page on the site as a string (to use as an email or newsletter). I tried: $string = file_get_contents('http://www.examplesite.com/path/to/page'); But $string just becomes false, which ...

Advantages / Disadvantages of pconnect option in CodeIgniter

One of the parameters in the CodeIgniter database config is the following ['pconnect'] TRUE/FALSE - Whether to use a persistent connection What do you recommend I set this to? Is there a significant performance hit if I set it to FALSE? What potential problems might arise from setting it to TRUE? ...

Display error when entire form is blank in CodeIgniter

I'm trying to create a fairly simple form that has a few checkboxes and input fields and a textarea. Nothing is required by itself; however, if 'A' checkbox is checked, then 'A' input field is required (and so on for the couple other checkboxes I have). I have the above functionality in place, but I'm having a tough time figuring out h...

CodeIgniter configuration with mod_rewrite, xampp and windows.

I'm a noob to CodeIgniter and am trying to figure out the configuration for an app I'm building. Something is wrong with my setup. I'm running XAMPP on Windows and am using an alias directory to point to the applications directory. In other words: "http://localhost/app_name/ " points to the root directory of the application. It all s...

Sending data along with a redirect in CodeIgniter

I have a simple C (of CRUD) function, and I'd like to send a message (error or success) along with my redirect from the "insert" function I have written up. Is there a way to adhere a POST field with a redirect? In pseudo code I have: function view_all{ //set up some initial variables $this->load->view(viewing_page, $data) } f...

Relative / Root paths on apache / cpanel / php shared hosting

Hi all. I am trying to deploy a php / codeigniter project to a shared hosting environment. Locally I am running MAMP and all my paths are referenced thus:- background:transparent url(/img/myimj.jpg) left top no-repeat; When I deploy the shared host, these links do not work and to resolve them I need to add "../". Changing all these r...

how to take a report in CSV format in php codeigniter

how to take a report in CSV format in php codeigniter ...

Css/images/javascript in codeigniter

Concerning this post, I'd like to add css,images and js to my codeigniter application. My question is after you add path to your header file href="<?php echo base_url();?>css/moorainbow.css" , where do you actually put your files, is it in system, application, view or controller? I found like 10 articles so far explaining the same proced...

Strange output 'Array' with php / codeigniter

Hi I was following code igniter user guide for forms and I encountered this strange output can anyone tell how to fix it? Here is my code for beginning of the form <?=$attributes = array('class' => 'email', 'id' => 'myform');?> <?=form_open('email/index/', $attributes); ?> I get form with id and class which I specified above but for...

Codeigniter admin/auth system?

I'm starting a new project with codeigniter, and I'd like to start on a system that's already built so I can reduce the time of development. Is there a good system that handles user authentication along with an admin interface to manage users that can be easily expanded to a web-app? If this is too vague, I can expand ...

Problem with login button value

Hi I've just started couple of days ago with codeigniter, I have a following problem. When I set value of login button to "" (no value) in order to style it with css properly the login form won't work, the value needs to be login, is there a way arround it I'm sure there is got to be the way.. Here is some code .. Controller : <?php c...