codeigniter

connect external db with codeIgniter

我怕爱的太早我们不能终老 提交于 2020-01-06 02:49:08
问题 i am new in code igniter, i tried to connect with local db then successfully connected,but while connecting with external db it resulting an error A PHP Error was encountered Severity: Warning Message: mysqli::real_connect(): (HY000/2003): Can't connect to MySQL server on 'xxxxx.gridserver.com' (110) Filename: mysqli/mysqli_driver.php Line Number: 202 Backtrace: File: /var/www/html/restapi/application/libraries/REST_Controller.php Line: 375 Function: __construct File: /var/www/html/restapi

save session in database by CodeIgniter

放肆的年华 提交于 2020-01-06 02:49:06
问题 I want to save session in database.in CodeIgniter user guide , make an example to store some data in database. CREATE TABLE IF NOT EXISTS `ci_sessions` ( session_id varchar(40) DEFAULT '0' NOT NULL, ip_address varchar(16) DEFAULT '0' NOT NULL, user_agent varchar(50) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, user_data text DEFAULT '' NOT NULL, PRIMARY KEY (session_id) ); Now I want to store an extra data by session in datbase,for example request_token value. $this->session-

URL array codeigniter

做~自己de王妃 提交于 2020-01-06 02:24:05
问题 I'm using codeigniter (newbie at codeigniter). I have a function getproducts($p1, $p2, $p3) in a controller. When I call getproducts/0/0/ from my jquery-script (ajax) it works, but I want to call URL like this : getproducts/0/0/{"0":"13","1":"24"} it doesn't work. (I get into to google-search-results instead of staying at my local webserver) I basically want to pass an array to a function in the url somehow when using codeigniter. How should I solve that? Please help :-) 回答1: I think you

Unable to include Cloud Storage Tools library in App Engine

会有一股神秘感。 提交于 2020-01-05 22:18:44
问题 In my CodeIgniter project, I am unable to include the Cloud Storage Tools PHP library, as used in lots of example PHP code. I have put the following at the top of an Controller extension, but I get an error when trying to use "CloudStorageTools::createUploadUrl()" require_once 'google/appengine/api/cloud_storage/CloudStorageTools.php'; use google\appengine\api\cloud_storage\CloudStorageTools; This is the error: PHP Fatal error: Class 'CloudStorageTools' not found Is this library automatically

Unable to include Cloud Storage Tools library in App Engine

时光毁灭记忆、已成空白 提交于 2020-01-05 22:18:18
问题 In my CodeIgniter project, I am unable to include the Cloud Storage Tools PHP library, as used in lots of example PHP code. I have put the following at the top of an Controller extension, but I get an error when trying to use "CloudStorageTools::createUploadUrl()" require_once 'google/appengine/api/cloud_storage/CloudStorageTools.php'; use google\appengine\api\cloud_storage\CloudStorageTools; This is the error: PHP Fatal error: Class 'CloudStorageTools' not found Is this library automatically

Unable to include Cloud Storage Tools library in App Engine

允我心安 提交于 2020-01-05 22:18:00
问题 In my CodeIgniter project, I am unable to include the Cloud Storage Tools PHP library, as used in lots of example PHP code. I have put the following at the top of an Controller extension, but I get an error when trying to use "CloudStorageTools::createUploadUrl()" require_once 'google/appengine/api/cloud_storage/CloudStorageTools.php'; use google\appengine\api\cloud_storage\CloudStorageTools; This is the error: PHP Fatal error: Class 'CloudStorageTools' not found Is this library automatically

jQuery to PHP - serialized strings

喜夏-厌秋 提交于 2020-01-05 17:48:11
问题 I'm currently AJAX'ing a login form. var data = $(this).serialize(); This is the data I'm sending, I get this with PHP using Codeigniter like so: $ajax = $this->input->post('data'); This returns username=john&password=doe as you'd expect. How do I turn that into an array? I've tried doing unserialize() and I get null. 回答1: I believe you can use PHP's parse_str() function: http://php.net/manual/en/function.parse-str.php <?php $str = "first=value&arr[]=foo+bar&arr[]=baz"; parse_str($str); echo

How to change url of GET method form to slashes in codeigniter 3 [duplicate]

杀马特。学长 韩版系。学妹 提交于 2020-01-05 13:14:23
问题 This question already has an answer here : How to extract get variable from query string in codeigniter? (1 answer) Closed 3 years ago . I can not find a solution to my problem, if my question is a duplicate, please provide a reference link. so I need your help. Here's for example: localhost/ci/index.php/search/?song=sheila+on+7 to be localhost/ci/index.php/search/sheila_on_7 or localhost/ci/index.php/search/song/sheila_on_7 Thanks. 回答1: CodeIgniter optionally supports this capability, which

Unable to load the requested file error - codeigniter

▼魔方 西西 提交于 2020-01-05 12:58:41
问题 In the codeigniter I get this message : Unable to load the requested file: home.php controller : cp/ Login views : cp/ home.blade.php class Login extends BaseController { public function __construct(){ parent::__construct(); } function index() { $this->load->view('home',''); } } or : class Login extends BaseController { public function __construct(){ parent::__construct(); } function index() { $this->load->view('cp/home',''); } } http://www.vitrinsaz1.ir/Mobile/Vitrinsaz/Pannel/cp/login 回答1:

receive more response data in ci-merchant library codeigniter

喜欢而已 提交于 2020-01-05 12:02:57
问题 How can I receive more response data in the ci-merchant codeigniter library ? I am using the Paypal Express checkout payment method. And I am passing the following parameters: $params = array( 'amount' => 100.00, 'currency' => 'USD', 'return_url' => my return url, 'cancel_url' => my cancel url ); Right now am getting just the following response Merchant_paypal_api_response Object ( [_status:protected] => complete [_message:protected] => [_reference:protected] => 1K088384XU0947545 [_data