codeigniter

Submit form within bootstrap modal using ajax and codeigniter without page change

允我心安 提交于 2019-12-24 01:57:16
问题 I am trying to submit a form within a bootstrap modal using ajax. And my form is successfully submitted, but the success statements within ajax are not executed. The page is redirected to a blank page saying {"msg":"ok"}. I am pasting the code from controller and view. Please help. Controller $update_profile_details = $this->userp_m->edit_profile_m($uname,$uemail,$data1,$new_email); if($update_profile_details == true) { $status['msg'] = 'ok'; } else { $status['msg'] = 'err'; } echo json

permitted_uri_chars in codeigniter

醉酒当歌 提交于 2019-12-24 01:56:16
问题 I am getting en error of "The URI you submitted has disallowed characters" when returning from facebook (using facebook login). i have set permitted_uri_chars as follows: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?='; and my url is: http://www.example/login?state=460f0c9e013ecc3fcbeeas9592ba2cf2e&code=AQDWuAZtPI3UK6vZVL8NL5h0LE28z1jdMRtAbFVjB0IUM7P5WsGFijwlgmzGGZWM37TG0tnCeD8YD-bqCKxilATkyJpiE6UdXhdN0s_s

Codeigniter MVC, should i move my business logic from model into Controller to use ORM?

天大地大妈咪最大 提交于 2019-12-24 01:43:17
问题 Im trying to migrate my current project from using regular CI query builder to use an ORM since my database is growing larger and i have more that 20 FK and relation between tables. so i'm currently searching for a nice orm for CI. i found IgnitedRecord but i faced a huge problem. example models/users.php: class user extends IgnitedRecord { public function is_loged(){ return $this->session->userdata('user'); } Problem is that $this is not pointing to CI anymore, and it return Undefined

unable to get proper data with AngularJS post method

ε祈祈猫儿з 提交于 2019-12-24 01:37:08
问题 this is my 1st time with AngulerJS. I'm trying to POST data to the server. AngularJS Code var app = angular.module("myApp", []); var BASE_URL = "http://localhost/project/api/Data/"; var GET_DATA = BASE_URL+"get_data"; console.log(GET_DATA); app.controller('myCtrl', function($scope, $http) { var inputs = { "user_id": "3"}; var config = { headers : { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;' } } $http.post(GET_DATA , inputs, config) .success(function (response, status,

Display Album with Photos (PHP)

随声附和 提交于 2019-12-24 01:33:24
问题 To start off, this really isn't CodeIgniter specific. I'm having trouble grasping an idea, so anyone that knows PHP/SQL (or whatever my problem is) can jump in. I have 2 tables, 'Photo' and 'Album'. Album columns : ID TITLE USER_ID CREATED MODIFIED Photo columns : ID ALBUM_ID TITLE LOC CREATED MODIFIED I'm using the query $this->db->select('*'); $this->db->from('album'); $this->db->join('photo', 'album.id = photo.album_id'); $this->db->limit(10); return $this->db->get(); which I think

Display Album with Photos (PHP)

隐身守侯 提交于 2019-12-24 01:32:17
问题 To start off, this really isn't CodeIgniter specific. I'm having trouble grasping an idea, so anyone that knows PHP/SQL (or whatever my problem is) can jump in. I have 2 tables, 'Photo' and 'Album'. Album columns : ID TITLE USER_ID CREATED MODIFIED Photo columns : ID ALBUM_ID TITLE LOC CREATED MODIFIED I'm using the query $this->db->select('*'); $this->db->from('album'); $this->db->join('photo', 'album.id = photo.album_id'); $this->db->limit(10); return $this->db->get(); which I think

Display Album with Photos (PHP)

柔情痞子 提交于 2019-12-24 01:32:05
问题 To start off, this really isn't CodeIgniter specific. I'm having trouble grasping an idea, so anyone that knows PHP/SQL (or whatever my problem is) can jump in. I have 2 tables, 'Photo' and 'Album'. Album columns : ID TITLE USER_ID CREATED MODIFIED Photo columns : ID ALBUM_ID TITLE LOC CREATED MODIFIED I'm using the query $this->db->select('*'); $this->db->from('album'); $this->db->join('photo', 'album.id = photo.album_id'); $this->db->limit(10); return $this->db->get(); which I think

Remove index.php from URL (CodeIgniter)

做~自己de王妃 提交于 2019-12-24 01:14:27
问题 I've removed the index.php throught this code: RewriteEngine on RewriteCond $1 !^(index\.php|assets|robots\.txt) RewriteRule ^(.*)$ /leet/index.php/$1 [L] But when I submit form <?=form_open('signup');?> and the page refreshes the url changes its value to localhost/ci/index.php/signup . Is it possible to remove it? 回答1: You must check your config.php inside your application\config directory, as you can see, locate your $config['index_page'] = 'index.php'; Change that to $config['index_page']

CodeIgniter - strange output issue

偶尔善良 提交于 2019-12-24 01:13:22
问题 I'm seeing a very strange issue with script output. I’m sometimes getting a four digit hexadecimal code before the output begins, and a zero at the end of output - for example: 2fc3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html > ...... </html> 0 The hex number varies depending on requested uri and / or contents. I'm not using caching and output compression is off. I've seen this issue on a couple of projects,

getting three records in descending order of each category using codeigniter

烈酒焚心 提交于 2019-12-24 00:58:06
问题 I've two categories and I want to fetch three records of each category later I found this link UNION query with codeigniter's active record pattern after this I change my DB_Active_rec file and add this code also var $unions = array(); public function union_push($table = '') { if ($table != '') { $this->_track_aliases($table); $this->from($table); } $sql = $this->_compile_select(); array_push($this->unions, $sql); $this->_reset_select(); } public function union_flush() { $this->unions = array