codeigniter

How to Get File Size of Files on FTP Server?

人盡茶涼 提交于 2020-01-07 02:59:12
问题 I need a list of all the files (and associated file sizes) on an FTP server. I can get a list of files using CodeIgniter’s FTP class, but no idea how to get the file size. How do I get the file sizes? Thanks. 回答1: I know nothing about CodeIgniter's FTP class, but what about this? http://www.php.net/manual/en/function.ftp-rawlist.php I assume that the FTP class' list_files() method doesn't provide this info. Is that correct? 回答2: Just had a quick look at CodeIgniters FTP class.. As its written

CI3/ Validation Rules to a Config File & Using a callback

回眸只為那壹抹淺笑 提交于 2020-01-07 02:57:10
问题 I am unable to figure out where to place my callback when using validation rules to a config file in CI3. Here is my form_validation.php: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $config = array( 'blog_post' => array( array( 'field' => 'entry_name', 'label' => 'entry_name', 'rules' => 'min_length[8]|trim|required|max_length[255]' ), array( 'field' => 'entry_body', 'label' => 'entry_body', 'rules' => 'trim|required|min_length[12]|callback_html_length_without

pass two query result to view in codeigniter

白昼怎懂夜的黑 提交于 2020-01-07 02:55:19
问题 i have two query $q1 and $q2. from the query1 i get multiple records and each record having id and i want use this id for second query in where condition. i am doing this in controller. i have tried following code. In the foreach i am trying to store id and pass to $q2 where condition. //Query 1 $q1 = $this->db->select(array( 'spf.id as id' , 'spf.name', 'spf.added_on' ))->from('sp_form spf')->where($where)->order_by('spf.id desc')->limit(10, $page * 10)->get(); $data['data'] = $q1->result

Codeigniter template class: check if pseudo variables have a value

ぃ、小莉子 提交于 2020-01-07 02:36:08
问题 Not sure if it's possible, but can you use if statements inside a template? So if a phone number does not have a value I don't want to display that sentence at all... <!DOCTYPE html> <html lang='en'> <head> <meta charset="utf-8"/> <title>{form_title}</title> </head> <body> <p>You received the following message from {name} through the Gossip Cakes' contact form.</p> <p>Their email is {email}</p> <p>Their phone number is {phone}</p> <p>The message: {message}</p> </body> </html> I guess I could

Codeigniter multiple database join

二次信任 提交于 2020-01-07 02:31:08
问题 I am using codeigniter framework. I am not much experienced in this framework. I need help of you guys. I want to join two table present in two different database. In both the table I have one common column. I understand, first I have to create a separate database group inside the file database.php. I have created the group and am able to use ths group in my model separately. I have also loaded another group in my model "default group". Whenever, I am trying to use each group separately it's

Upload file type

百般思念 提交于 2020-01-07 02:24:19
问题 I've created an upload file and it won't save in database. I created the controller and the view like codeigniter tutorial says. I put in the config the allowed_types. $config['allowed_types'] = 'gif|jpg|png|jpeg'; and it continues to show me this: The filetype you are attempting to upload is not allowed. What should I do? 回答1: This is an issue that occurs in CodeIgniter 2.1.0 and PHP v5.2.x. If you downgrade back to CodeIgniter 2.0.3, the upload problem should go away. 回答2: Replace your

Upload file type

你说的曾经没有我的故事 提交于 2020-01-07 02:24:00
问题 I've created an upload file and it won't save in database. I created the controller and the view like codeigniter tutorial says. I put in the config the allowed_types. $config['allowed_types'] = 'gif|jpg|png|jpeg'; and it continues to show me this: The filetype you are attempting to upload is not allowed. What should I do? 回答1: This is an issue that occurs in CodeIgniter 2.1.0 and PHP v5.2.x. If you downgrade back to CodeIgniter 2.0.3, the upload problem should go away. 回答2: Replace your

How to export array to CSV in Codeigniter?

房东的猫 提交于 2020-01-07 02:18:29
问题 $Data[] = array('x'=> $x, 'y'=> $y, 'z'=> $z, 'a'=> $a); I want to export this array to CSV. I am using CodeIgniter. 回答1: You can try this code for your export array to CSV. <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Import extends CI_Controller { public function __construct() { parent::__construct(); } public function exports_data(){ $data[] = array('x'=> $x, 'y'=> $y, 'z'=> $z, 'a'=> $a); header("Content-type: application/csv"); header("Content-Disposition:

Paypal integration: Please return to the payment page and correct the address

元气小坏坏 提交于 2020-01-07 02:17:14
问题 I'm trying to do a payment on my web with a VISA card and when i press Pay i get this error: Please return to the payment page and correct the address. Debug of input hidden values: cmd->_hosted-payment subtotal->0.6 business->--deleted-- currency_code->GBP template->templateD billing_first_name->Fulanito billing_last_name->Benganito billing_address1->Pepito Nº 14 billing_city->Temple (Vinewood) billing_zip->29013 billing_country->Spain lc->US Any idea? Thanks, regards. 回答1: I figured it out,

Store multidimension array in userdata session codeigniter

邮差的信 提交于 2020-01-07 01:19:43
问题 I want to store multi dimension array in codeigniter userdata session. when i store a simple array it works fine. but in multi dimension it store nothing. Is there a way to store multi dimension array in session. My code is: foreach ($unique_data as $unique_type) { $indexes = index_unique_values($product_all_data, 'type', $unique_type['type']); foreach ($indexes as $key) { $product_name = $product_all_data[$key]['name']; $product_type = $product_all_data[$key]['type']; $product_status =