codeigniter-2

You are not a sandbox user of this client. Error Codeigniter-Instagram api

早过忘川 提交于 2020-01-22 19:04:04
问题 In my codeigniter project I am trying to use Instagram API for log in. This is the library which I am using. But when going to the login page, it is showing error {"code": 403, "error_type": "OAuthForbiddenException", "error_message": "You are not a sandbox user of this client"} The sample url is https://www.instagram.com/oauth/authorize/?client_id=[client ID]&redirect_uri=[your url]&response_type=code Why it is working like this? Any help could be appreciated 回答1: As per this error: {"code":

How to send variable data when redirecting to previous page

孤街浪徒 提交于 2020-01-22 12:31:46
问题 I am using the following codes to redirect my user to previous page after a particular task is done. if (isset($_SERVER['HTTP_REFERER'])) { $this->session->set_userdata('previous_page', $_SERVER['HTTP_REFERER']); } else { $this->session->set_userdata('previous_page', base_url()); } The above code I use in a controller and the following code in another controller.. .... some other stuffs... I am updating database values here.... $this->db->where('t_expenseid', $t_expenseid); query=$this->db-

How to pass variables from controller to view

霸气de小男生 提交于 2020-01-17 05:03:07
问题 iam using codeigniter 2.2 The following is my controller class class Welcome extends CI_Controller { public function index() { $test = "hello"; $this->load->view('welcome_message',$test); } } The following is my view <html><body><h1><?php echo $data?></h1></body></html> trying to pass a variable to the view keep getting this error A PHP Error was encountered Severity: Notice Message: Undefined variable: data Filename: views/welcome_message.php Line Number: 75 回答1: Try this, class Welcome

Twig date filter not working with DateTime object

谁说我不能喝 提交于 2020-01-15 12:45:12
问题 I'm using CI2 with Doctrine2 and Twig for the template engine. I'm trying to display the date from an entity as a string, however it's not working for me. I'm sending an array of Entity objects to the template, iterating through them, and displaying their properties: {% for e in entities %} <span><label>username</label>{{e.getUserName}}</span> <span><label>email</label>{{e.getEmail}}</span> <span><label>date created</label>{{e.getCreatedAt | date('d.M.Y H:i:s')}}</span> {% endfor %} The

Twig date filter not working with DateTime object

天大地大妈咪最大 提交于 2020-01-15 12:45:06
问题 I'm using CI2 with Doctrine2 and Twig for the template engine. I'm trying to display the date from an entity as a string, however it's not working for me. I'm sending an array of Entity objects to the template, iterating through them, and displaying their properties: {% for e in entities %} <span><label>username</label>{{e.getUserName}}</span> <span><label>email</label>{{e.getEmail}}</span> <span><label>date created</label>{{e.getCreatedAt | date('d.M.Y H:i:s')}}</span> {% endfor %} The

Wordpress Codeigniter Integration: How to replace site_url on CI?

南笙酒味 提交于 2020-01-15 10:54:50
问题 I have some problem with URL of Wordpress and Codeigniter integration, because I want to avoid data collisions between WP and CI site_url. Here is my code on CI : config.php $config['base_url'] = 'http://www.mydomain.com'; my_helper.php add_filter('site_url', 'ci_site_url', 1); function ci_site_url() { include(APPPATH.'/config/config.php'); return $config['base_url']; } It works fine and show http://www.domain.com when I use <?php echo site_url(); ?> I want http://www.domain.com/index.php

CodeIgniter: pagination doesn't have question mark?

空扰寡人 提交于 2020-01-14 09:36:07
问题 The code below generates pagination using query strings. However, there is no leading ? . So, I get something like this: http://localhost/index.php/search/&limit=10 . Any ideas why? this->load->library('pagination'); $config = array(); $config['base_url'] = 'http://localhost/index.php/search/'; $config['total_rows'] = 200; $config['per_page'] = 10; $config['num_links'] = 4; $config['full_tag_open'] = '<ol>'; $config['full_tag_close'] = '</ol>'; $config['first_link'] = 'First'; $config['first

Routing problems with Codeigniter and Backbone.js

拥有回忆 提交于 2020-01-12 03:53:24
问题 Here are the frameworks I am using: Codeigniter Codeigniter REST API Require.js Backbone.js Running the app: The htaccess file redirects everything through the Codeigniter index.php file. There is a default route setup in Codeigniter to call the "Start" Controller. The Start Controller calls the Start View (the only view in Codeigniter ). The Start View holds the template for the entire website and makes a call to start Require.js Require.js starts up Backbone and app works as expected.

Codeigniter htaccess not working on godaddy?

夙愿已清 提交于 2020-01-11 11:29:34
问题 I recently moved to godaddy Linux hosting and the .htaccess doesn't seem to work. Are there any settings which need to be done for godaddy because the .htaccess was working on local xampp server as well as hostek server.I am getting "404 Not Found" error message.i am using CodeIgniter-2.2.1 framework also i have check mod_rewrite in Loaded Modules in php.ini file was not found enable from server side . My htaccess file located on root directory where my application is deployed. RewriteEngine

Codeigniter 2 - Callback function in My_Controller

北慕城南 提交于 2020-01-10 05:42:06
问题 I have all my callback functions in My_Controller so that they are not repeated throughout the website. This works fine but for some reason one of my functions is not working when I am posting information using AJAX but is working on other pages. The message I get back when I use the callback is: Unable to access an error message corresponding to your field name. But then I've created a message for it using set_message() and it works fine on the other page without AJAX. If you were interested