codeigniter

CodeIgniter session behind proxy

半城伤御伤魂 提交于 2020-01-12 21:01:14
问题 What happens when you don't have a list of proxy IPs? When using site acceleration services like Akamai, Google, Edgecast or CloudFront; it would always be hard to get IPs for sessions from them. When testing our codeigniter application on a CDN, we noticed that IPs were being passed as CDN IPs and not the client IPs in the session database. How can you get around to this? /* |-------------------------------------------------------------------------- | Reverse Proxy IPs |---------------------

CodeIgniter session behind proxy

℡╲_俬逩灬. 提交于 2020-01-12 21:00:23
问题 What happens when you don't have a list of proxy IPs? When using site acceleration services like Akamai, Google, Edgecast or CloudFront; it would always be hard to get IPs for sessions from them. When testing our codeigniter application on a CDN, we noticed that IPs were being passed as CDN IPs and not the client IPs in the session database. How can you get around to this? /* |-------------------------------------------------------------------------- | Reverse Proxy IPs |---------------------

The Encrypt library requires the Mcrypt extension

淺唱寂寞╮ 提交于 2020-01-12 19:09:13
问题 I have a php application written using codeigniter framework. When I am trying to run this application on Windows Machine then I am getting below error: An Error Was Encountered The Encrypt library requires the Mcrypt extension. This same application working fine on some random Windows Machine having same configuration.I have tried on 5 different windows 10 machine and got this error on 3 Machine and worked fine on 2 machine. Here I have used the same installer to install XAMPP on all the

PHP/CodeIgniter - Setting variables in __construct(), but they're not accessible from other functions

ⅰ亾dé卋堺 提交于 2020-01-12 19:05:10
问题 I'm happy a bit of a variable scoping problem. Maybe I just need more coffee... Here's my (simplified) code - this is in CodeIgniter 2: class Agent extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('agent_model'); // Get preliminary data that will be often-used in Agent functions $user = $this->my_auth_library->get_user(); $agent = $this->agent_model->get_agent($user->id); } public function index() { $this->template->set('info', $this->agent

PHP, Codeigniter: How to Set Date/Time based on users timezone/location globally in a web app?

淺唱寂寞╮ 提交于 2020-01-12 14:15:50
问题 I have just realised if I add a particular record to my MySQL database - it will have a date/time of the server and not the particular user and where they are located which means my search function by date is useless! As they will not be able to search by when they have added it in their timezone rather when it was added in the servers timezone. Is there a way in Codeigniter to globally set time and date specific to a users location (maybe using their IP) and every time I call date() or time(

PHP, Codeigniter: How to Set Date/Time based on users timezone/location globally in a web app?

余生长醉 提交于 2020-01-12 14:15:43
问题 I have just realised if I add a particular record to my MySQL database - it will have a date/time of the server and not the particular user and where they are located which means my search function by date is useless! As they will not be able to search by when they have added it in their timezone rather when it was added in the servers timezone. Is there a way in Codeigniter to globally set time and date specific to a users location (maybe using their IP) and every time I call date() or time(

How would i create a vanity url in codeigniter

和自甴很熟 提交于 2020-01-12 10:30:47
问题 How can i create a vanity url in codeigniter. Im having real trouble doing this in the framework. And there doesnt seem to be any good answers out there. 回答1: It's possible, I'm using this in one of my projects... Here is a thread on the CodeIgniter forums showing how to do it... http://codeigniter.com/forums/viewthread/113962/ 回答2: According to Personalized User Vanity URL's in CodeIgniter, you can accomplish this by modifying your routes file: $handle = opendir(APPPATH."/modules"); while

Question about how redirects should work

帅比萌擦擦* 提交于 2020-01-12 07:53:22
问题 So I have a web app that i'm working on with a form that requires all of the fields to be populated before submitting. If you try to submit the app without a field being populated, it loads the page again with the errors. Once you fill all the fields in and click submit, it does a redirect to the same page and shows a message which is generated from flashdata. See simplified example below. Welcome controller: function show_view() { $this->load->view('form'); } function process_form() { //

Question about how redirects should work

牧云@^-^@ 提交于 2020-01-12 07:52:06
问题 So I have a web app that i'm working on with a form that requires all of the fields to be populated before submitting. If you try to submit the app without a field being populated, it loads the page again with the errors. Once you fill all the fields in and click submit, it does a redirect to the same page and shows a message which is generated from flashdata. See simplified example below. Welcome controller: function show_view() { $this->load->view('form'); } function process_form() { //

How to send a post request to the RESTserver api in php-Codeigniter?

你。 提交于 2020-01-12 07:34:09
问题 I've been trying to make a POST request in my CodeIgniter RestClient controller to insert data in my RestServer, but seems like my POST request is wrong. Here is my RestClient POST request in controller: $method = 'post'; $params = array('patient_id' => '1', 'department_name' => 'a', 'patient_type' => 'b'); $uri = 'patient/visit'; $this->rest->format('application/json'); $result = $this->rest->{$method}($uri, $params); This is my RestServer's controller: patient function visit_post() {