codeigniter

Codeigniter - Restricting direct access to controller functions from URL call

佐手、 提交于 2019-12-23 00:24:15
问题 I want to know if there is any way through which I can restrict access to my controller functions through URL. But I want to give them a call through my link in the site. For example if I have a link in my site which points to a controller function: <a href='test/function'>Call me</a> But I don't want the controller function to be called when I place the above URL in my browser address bar. Can anyone help with this? 回答1: As you stated in the comment, that if you want to load the link via

codeigniter connect two database

丶灬走出姿态 提交于 2019-12-22 22:47:50
问题 I use codeigniter 2.1.4 . I record my session to my database1 , and I query database2 data. But session will not found database2 table. I don't want to record session to database2 . The error message. A Database Error Occurred Error Number: 1146 Table 'database2.sessions' doesn't exist SELECT * FROM (`sessions`) WHERE `session_id` = 'fd384ac44b1fe1c073cfc23185esdfda' AND `user_agent` = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76

jquery datatable serverside in codeigniter not working

寵の児 提交于 2019-12-22 21:06:32
问题 I tried to combine the data using datatable serverside in codeigniter via ajax, But i get the error result, like this: A Database Error Occurred Error Number: 1096 No tables used SELECT * ORDER BY id_judul ASC LIMIT 2 Filename: models/Judul_model.php Line Number: 88 model: <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Judul_model extends MY_Model { //Server side var $column_order = array(null,'isbn','judul_buku','penulis','penerbit',null,null,'letak'); //set

Facebook API's require_login to work with CodeIgniter

蹲街弑〆低调 提交于 2019-12-22 19:01:53
问题 Currently if I use facebook's require_login, it appears to go into an infinite loop of appending to the url. All of my controllers inherit from a FB_Controller that upon construction does: $this->facebook = new Facebook($this->API_KEY, $secret); $this->uid = $this->facebook->require_login(); //Causes infinite loop! I had to explicitly set the canvas callback URL on Facebook to http://decider.dfgh.org/ask/index/ (where ask is my desired default controller) or else I get a 404 error. Also I'm

Facebook API's require_login to work with CodeIgniter

南笙酒味 提交于 2019-12-22 19:01:13
问题 Currently if I use facebook's require_login, it appears to go into an infinite loop of appending to the url. All of my controllers inherit from a FB_Controller that upon construction does: $this->facebook = new Facebook($this->API_KEY, $secret); $this->uid = $this->facebook->require_login(); //Causes infinite loop! I had to explicitly set the canvas callback URL on Facebook to http://decider.dfgh.org/ask/index/ (where ask is my desired default controller) or else I get a 404 error. Also I'm

Dynamic added form fields based on 1-to-n relation - What framework alternatives? [closed]

让人想犯罪 __ 提交于 2019-12-22 18:51:11
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . We have to develop a multi-model form that should use ajax calls to dynamically add or remove, sub-model fieldsets. For example, let's imagine this team form scenario : Team: Team Name: Team Country: Members: Member A name: Member A age: [add another member] [REGISTER TEAM AND MEMBERS] We are using Yii at the

Dropbox api not working in codiegniter?

China☆狼群 提交于 2019-12-22 18:46:30
问题 public function request_dropbox() { $params['key'] = 'gr3kempuvsiqsli'; $params['secret'] = 'qtdl8lmm9r0rlk1'; $this->load->library('dropbox', $params); $data = $this->dropbox->get_request_token(base_url()); $this->session->set_userdata('token_secret', $data['token_secret']); redirect($data['redirect']); } //This method should not be called directly, it will be called after //the user approves your application and dropbox redirects to it public function access_dropbox() { $params['key'] =

session destroying in codeigniter after redirecting

夙愿已清 提交于 2019-12-22 18:35:54
问题 In my login controller i have stored all user data in session. i have verified also by printing all_userdata(); when redirected to another controller home the session was destroyed. please help me to solve this issue. The session data is as follows. Array ( [session_id] => 11c8450a10e6f944c97f13841ccea0c2 [ip_address] => 127.0.0.1 [user_agent] => Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 [last_activity] => 1408779229 [user

How to resolve the error: Message: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused)

只谈情不闲聊 提交于 2019-12-22 18:24:07
问题 I'm using codeigniter I created one email function to send email to particular email ID public function email($email){ $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.gmail.com'; $config['smtp_timeout']=5; $config['smtp_port'] = '465'; $config['smtp_user'] = 'MyEmailID@gmail.com'; $config['smtp_pass'] = '********************'; $config['mailtype'] = 'html'; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; $config['wordwrap'] = TRUE; $this->load->library('email');

How to resolve the error: Message: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused)

旧城冷巷雨未停 提交于 2019-12-22 18:23:38
问题 I'm using codeigniter I created one email function to send email to particular email ID public function email($email){ $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.gmail.com'; $config['smtp_timeout']=5; $config['smtp_port'] = '465'; $config['smtp_user'] = 'MyEmailID@gmail.com'; $config['smtp_pass'] = '********************'; $config['mailtype'] = 'html'; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; $config['wordwrap'] = TRUE; $this->load->library('email');