Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function proses_tambah_user(){
- $config['upload_path'] = "./assets/images/";
- $config['allowed_types'] = 'gif|jpg|png|jpeg';
- $config['max_size'] = '2000';
- $config['max_width'] = '2000';
- $config['max_height'] = '2000';
- $this->load->library('upload', $config);
- if ($this->upload->do_upload("foto")) {
- $data = $this->upload->data();
- $source = "./assets/images/".$data['file_name'] ;
- $nama=$data['file_name'] ;
- chmod($source, 0777) ;
- $this->load->library('image_lib') ;
- $img['image_library'] = 'GD2';
- $img['create_thumb'] = TRUE;
- $img['maintain_ratio']= TRUE;
- $data = array(
- "username" =>$this->input->post('username'),
- "password" =>md5($this->input->post('password')),
- "password_view" =>$this->input->post('password'),
- "email" =>$this->input->post('email'),
- "foto" =>$nama,
- );
- $this->m_Backend->tambah_data_user($data);
- redirect(site_url('Backend/user'));
- }else{
- echo "Failed!" ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment