|
 |
|
ช่วยด้วยค่ะ (เกิดปัญหา) ทำinsertข้อมูลและอัพโหลดรูป error Message: Use of undefined constant full_path - assumed 'full_path' ไม่รู้แก้ยังไง (มือใหม่คะ) |
|
 |
|
|
 |
 |
|
ไฟล์ : Controller
Code (PHP)
public function managepackage()
{
$config['upload_path'] = 'images/';
$config['allewd_types'] = 'gif|jpg|png|jpeg';
$this->load->library('upload', $config);
$this->upload->do_upload('file_name');
$data_upload_files = $this->upload->data();
$image = $data_upload_files[full_path];
$data = array(
'name'=>$this->post('name'),
'type'=>$this->post('type'),
'description'=>$this->post('description'),
'duration'=>$this->post('duration'),
'price_adult'=>$this->post('price_adult'),
'price_child'=>$this->post('price_child'),
"create_date"=>date('Y-m-d H:i:s'),
'file_name'=>$image);
$this->db->insert('package' ,$data);
}
ขึ้น error

Tag : PHP, CodeIgniter Framework

|
|
 |
 |
 |
 |
Date :
2013-12-21 20:21:27 |
By :
maiky |
View :
804 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
public function add_user()
{
$config['upload_path'] = '/file_path/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$this->load->library('upload', $config);
$this->upload->do_upload('profilepic');
$data_upload_files = $this->upload->data();
$image = $data_upload_files[full_path];
$data = array(
'membership'=>$this->input->post('membership_type'),
'fullname'=>$this->input->post('fullname'),
'username'=>$this->input->post('username'),
'password'=>md5($this->input->post('password')),
'email'=>$this->input->post('email'),
'city'=>$this->input->post('city'));
'profilepic'=>$image;
$this->db->insert('members',$data);
}
ตัวอย่างครับ
|
 |
 |
 |
 |
Date :
2013-12-23 10:09:58 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังคงerror ที่ full_path คะ ทำไงดีคะ T^T
|
 |
 |
 |
 |
Date :
2013-12-26 12:39:30 |
By :
maiky |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|