codeigniter

What is the best practice for restricting specific pages to logged in users only in Codeigniter?

I have created a sign-up and login for my website and all validation works fine for both sign-up and login. After user provides valid credentials he/she is logged into the member area with a welcome message that says Hello first_name last_name.. basically first name and last name is grabbed from database. Any what I want to do is restri...

Codeigniter Routing not equal to pattern

Hi there I am working on a codeigniter app and am having some trouble wrapping my head around a routing issue. Basically I would like all routes to map to an specific controller action by default, but I would also like to able to specify an array of routes (or ideally initial url segments) which shouldn't follow this pattern. By way ...

Access controllers in sub directory

My controllers are at controllers/frontend directory I access them trough http://localhost/controller_name. In a routes.php i have that record $route['([a-z_]+)'] = "frontend/$1" and everything works. But how to change route rule if I want to access http://localhost/controller_name/method/param; ...

Best way to store complex relations of huge amount of data php/mysql

I'm trying to develop a web based digital asset management application. I'm planning to do it in Codeigniter with mysql as db. This is for a popular regional newspaper. They will have 1000 of entries and TB's of data as daily tons of information will be entered. There will be different content types like Media, Personality, Event, Issu...

Conflict between Codeigniter AUtoload and Flourish Autoload functions

I am developing a web application, using the Codeigniter ( http://codeigniter.com/ ) framework plus the Flourish library (unframework) ( http://flourishlib.com/ ). I simply dropped the flourish folder into my application, then I created a flourish initialization and config files as instructed (these create the Flourish autoload). This ...

Prepend New Section To Jquery UI Accordion When Link Is Clicked...? (Code Igniter)

Hello, I'd like to add a new section to a Jquery UI accordion when someone clicks a link, either on the same page or a different page. I've looked at the append() function but the content I'd be pulling in would contain PHP as well as HTML, so it'd need to be parsed. The link the user would be clicking would reference a database record...

How to reduce the number of queries required to get this result.

Hello, I'm writing an application on top of CodeIgniter to better organize my ebook collection. I'm nearly done, but I realize my 'browse' page is running far too many queries - two per book - to get their information. Obviously not at all ideal, especially since I have about 1000 books to put into this system. I currently have one mo...

submitting multiple rows to database with one form in codeigniter

Hi, I'm trying to create a bulk edit page for an app that I'm working on. The table contains rows of products each of which have three editable fields. <tr> <input type="hidden" name="id" value="10"> <td>SKU<td> <td>Product Name</td> <td> <select name="product_category" value="" tabindex="4"> <option value="1">Categ...

Code igniter MySQL AES with active records?

Hey, How would i use code igniters active records to insert/update/select data from a database using mysql's built in aes encrypt/decrypt functions? I know i could just use the normal sql query, but i'd like to use active records ideally. Thanks ...

SQL UPDATE not working?

In my LAMP application (using CodeIgniter), I have a call to $this->db->update... that generates a SQL like the following: UPDATE `MyTable` SET `MyProcess` = 5 WHERE `Id` = 1 The problem is that this seems to work intermittently -- and I currently have no idea what might be wrong. Is there anything about MySQL I need to know about whe...

how to insert data to two tables at the same time?

Hi Guys, I have this problem in my system, i need to register a patient to the system, patients reference_number is used to make a reservation in the hospital. problem i got is when a patient is registered to the system a reservation is made at the same time, i need to update two tables, patient table and reservation table, i have to ta...

codeigniter and ajax help

I have a form that has sections hidden until, the correct piece of data is submitted. I am wanting to do this through jQuery and ajax. I was hoping that I would be able show the next element on the form if the last piece entered into the database ok, currently my controller looks like this, function add_career() { $data = array();...

Code Igniter - Get Last URI Segment

Hello, I'm tying to get the last URI segment in CI, however I don't know what the number for it will be, as parameters (an integer) will be appended as the user clicks links within the page. These are then used in a controller to pull relevant database records into the page via ajax. How can I tell CI to get the last segment? Somethin...

How to invoke method from codeigniter controller when the page loads?

Hi guys. Can someone please tell me how to invoke a method from the codeigniter controller when the page loads? What I want to do is to fetch some data from database and put it inside meta tags before page actually load. I obviously want to do it inside header. It should be something like this: method, which fetches some data from db an...

How can I get the entire result set of a query here?

Hi, I've written the following CodeIgniter model function to grab and iterate through a MySQL query result. function get_book_info() { /* * SELECT b.isbn, b.title, b.publisher, b.date, b.thumb, b.filename, b.pages, t.tag * FROM books AS b * INNER JOIN books_tags AS bt ON b.isbn = bt.book_id * INNER JOIN tags AS t ON bt.tag_id = ...

How can I connect to a database manually in CodeIgniter?

Is it possible to connect to a database manually, using any set of drivers for php, in CodeIgniter? Would I just open a connection in the model? I have a need that CodeIgniter won't cover but I'd like to use it for it's MVC architecture. I just can't use it's ActiveRecord like in the demos with MySQL, etc. If I can just do a "regular...

Code Igniter / PHP - Undefined index? Easy points for someone...

Hello, This is probably obvious but I'm getting this error: A PHP Error was encountered Severity: Notice Message: Undefined index: outputcards Filename: controllers/site.php Line Number: 49 Here's the line in question: $out['outputcards'] .= $this->load->view('client_view_data',$data, TRUE); which is inside a for loop, and bei...

What's the best way to build a user to user messaging feature in codeigniter?

e.g. like emailing but in a website.. I've googled and can't seem to find anything. ...

Problem with multiple CodeIgniter installations on shared HostGator servers

I have a shared hosting plan with HostGator and multiple CI installations. For each installation, I've been able to successfully remove the "index.php" from the URL, but on my addon domain, none of my CSS, or JS, or image files load correctly. Here is what I have for mod rewrite on the main domain: RewriteEngine on RewriteCond $1 !^(i...

How to configure Context using PHP

Hi, Actully i am a java developer and new to PHP, I am using Code Ignitor as a frame work for my project.Setup site on my local machine. And accessing site using following URL. http://localhost/businesscaliber/index.php/home Where home is HomeController. here i want to context as http://localhost/businesscaliber rather than above UR...