Welcome Guest, Not a member yet? Register   Sign In
Fails to upload an image to the folder and the database
#1

Looks like the image is sent to the database but not to the folder. What do you think?
PHP Code:
public function input_siswa(){
    $config['upload_path']          './gambarfolder/';
    $config['allowed_types']        'gif|jpg|png';
    $config['max_size']            '100';
    $config['max_width']            '1024';
    $config['max_height']          '768';

    $this->load->library('upload');
    $this->upload->initialize($config);
    $location=base_url().'/gambarfolder/';
    $pict=$location.$data_imge;

    $nama_siswa $this->input->post('nama_siswa');
    $nis $this->input->post('nis');
    $id_jurusan $this->input->post('id_jurusan');
    $data = array(
            'nama_siswa'=>$nama_siswa,
            'nis'=>$nis,
            'id_jurusan'=>$id_jurusan,
            'gambar'=>$pict
              
);
    $this->m_model->create('siswa',$data);  
    redirect
(base_url('index.php/admin/tampil_siswa'));


Thank you in advance!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB