codeigniter

CodeIgniter ajax post

function new_review(){ $.post('restaurant_profile/get_dg_new_restaurant_review', {}, function callback(response) { alert(response); } } Hi I have a function that does an jQuery ajax post to a controller function. The function outputs a simple string using the PHP echo function. The function works fine if I don't ha...

Current URI Segment in CodeIgniter

What would be the best way to check for the current URI segment in a CodeIgniter view? What I am trying to do is use the current URI segment [i.e. $this->uri->segment(1)] in order to highlight the current page on the navigation bar. The best that I have figured out is to do $data['current_uri'] = $this->uri->segment(1); $this->load->v...

Codeigniter: Best way to structure partial views

How would you structure the below page in Codeigniter? I thought about creating seperate controllers for each section Left nav Content nav Login name Leaderboard Excluding the content section (as this changes depending on the link on the left nav and content nav used as a kinda sub-menu). All the other sections remain roughly the ...

Gmail and hotmail problem with Codeigniter or Godaddy?

I have setup a mail sender with the Codeigniter email library. Everything works fine until a user specifies a gmail or hotmail address as their address. eg $email = $this->input->post('[email protected]'); This is just a return address for me to reply to. The email itself is sent from a Godaddy email account. Im wondering if anyo...

codeigniter check for user session in every controller

Hey guys, I have this private session in one of my controllers that checks if a user is logged in: function _is_logged_in() { $user = $this->session->userdata('user_data'); if (!isset($user)) { return false; } else { return true; } } Problem is that I have more than one Controller. How can I use this function in those other...

codeigniter: where do entities go?

Hey, I was wondering what should I do with my entities? For example, a class named Articles, with a few datamembers (name/title/date) and getters & setters. I could add these to my Articles datamember, but it's better practice to seperate those. So what do you think? Thanks! ...

Password Protecting App in Development (Codeigniter)

Hello, I am developing a web application using CI at www.example.com . My CI install is located outside the www root folder. How do I go about password protecting my application while still allowing my "home page" (in this case the default controller/view in CI ) to be publicly accessible ? I.E. I want to develop my application withou...

How to extract get variable from query string in codeigniter?

Hello, My issue is i have QUERY_STRING enabled in my codeigniter setup so that links look like this http://www.domain.com/search/index/page/4?squery=searchterm I have a form on this page that uses GET because I can't use POST for what i'm using, when i try to retrieve the "squery" using $this->uri->segment(4) it doesn't return that pa...

jQuery .load : Response ok but content not loading

I'm using jQuery with CI for loading a view in this tag: <div id="browseresults"> </div> This script is placed after the </body> tag: <script type="text/javascript">//<![CDATA[ jQuery.noConflict(); jQuery(document).ready(function() { //Load the results view jQuery('#browseresults').load("<?= base_url() . $th...

CodeIgniter + jQuery .ajax form submit return results in a table row

Hello I think it should be fairly easy, I simply can not find an answer for it. I am using a Codeigniter for a simple CRUD application. It displays the result in table. What I did, was to use jQuery .ajax to submit the form. It works (almost) perfectly. I am able to submit a form without reload but the results are not shown unless I...

Confused About Objects and Classes in CodeIgniter?

I’m fairly new to CodeIgniter and have a question. I’m a bit confused about Classes, Libraries and Objects. Does CodeIgniter replace the normal PHP way of usings objects i.e. $var = new car(); with libraries i.e. $this->load->library('some_library'); $this->some_library->some_function(); ? If both are valid, is there a difference? If s...

Where to include JS files - does it matter?

A few questions today :) I am using Codeigniter. I have a header view, containing my tags which contains the universal JS file loads. It also contains the 'layout' of the page, links etc, sidebar, and then it opens the tag and main content . This is closed in my footer view which is loaded after and 'content' view. In one particula...

Codeigniter active records: like and where in SQL statement

I need to select several rows that respect these conditions: a) date >= today b) keyword present in fields 1, 2 or 3 i guess the SQL statement for this should be: SELECT * FROM events WHERE date >= '2010-09-12' AND (field1 LIKE '%keyword%' OR field2 LIKE '%keyword%' OR field3 LIKE '%keyword%') I am trying to write this using codeignit...

CodeIgniter URLs help

Hello, I'm planning on re-creating my lyrics website in CodeIgniter. At the moment, the way I have it set-up is like this: example.com/artistname and example.com/anotherartist I also have example.com/contact and example.com/request etc.. I can get it to be example.com/artist/artistname, but I'd really like to keep it simple for the us...

Codeigniter not maintaining aspect ratio

I would expect that $config['maintain_ratio'] = TRUE; would cause the width to be calculated if I only specify a height. I guess I have to provide any large number for the height to make it work? $config['image_library'] = 'gd2'; $config['source_image'] = $image_filepath; $config['new_image'] = $thumbnail_fil...

Dynamic URLs in CodeIgniter ?

How to get URLs like /user/bob user/martin dynamically in CodeIgniter? ...

namespace in php codeigniter framework

do codeigniter supports namespace? ...

Codeigniter user friendly url's

Hello there I'm trying to make my url's as user friendly as possible...so far I have managed to remove index.php (with .htaccess) and I have set $route['default_controller'] = "myController"; so my home page's url is pretty decent as it appears like localhost/myController but all the other url's have the structure localhost/myRoot/myCont...

How do you exit execution of a codeigniter program?

Hi everyone, I am currently working on adding pre-validation to my website. So that pages that require a log-in or other criteria, will only display if your session matches that criteria. I've got most of the system working, but I have one major obstacle. I cannot figure out how to stop CodeIgniter from running the rest of the controlle...

Am i passing the value correctly to my controller from jquery?

I am doing a delete on a table using jquery, $('table#chkbox td a.delete').click(function() { if (confirm("Are you sure you want to delete this row?")) { var id = $(this).parent().attr('id'); var parent = $(this).parent().parent(); $.ajax( { type: "...