Created
October 1, 2018 06:25
-
-
Save imranhoshain/ee2936f0586adfd27cf49012afd68814 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function save_admin(){ | |
| $data = array(); | |
| $data['admin_image'] = $this->input->post('admin_image',true); | |
| $sdata = array(); | |
| $error = ""; | |
| $config['upload_path'] = 'uploads/'; | |
| $config['allowed_types'] = 'gif|jpg|png'; | |
| $config['max_size'] = 100000; | |
| $config['max_width'] = 1024; | |
| $config['max_height'] = 768; | |
| $this->load->library('upload', $config); | |
| if ( ! $this->upload->do_upload('admin_image')) | |
| { | |
| $error = $this->upload->display_errors(); | |
| } | |
| else | |
| { | |
| $sdata = $this->upload->data(); | |
| $data['admin_image'] = $sdata['file_name']; | |
| } | |
| $this->db->INSERT('admin',$data); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment