Guest User

Untitled

a guest
Jan 16th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <div class="form-group">
  2. <label for="exampleFormControlFile1"><p>4 : Media * :</p></label>
  3. <p> <input type="file" name="file_name">
  4. </div>
  5.  
  6. public function create(){
  7. $config['upload_path'] = './uploads/';
  8. $config['allowed_types'] = 'jpg|png|jpeg';
  9. $this->load->library('upload', $config);
  10. $this->upload->do_upload('file_name');
  11.  
  12.  
  13. $file_name=$this->upload->data();
  14. $data=array(
  15. 'institute'=>$this->input->post('institute'),
  16. 'category'=>$this->input->post('category'),
  17. 'content'=>$this->input->post('content'),
  18. 'relavent_authority'=>$this->input->post('relavent_authority'),
  19. 'multimedia'=>$file_name['file_name'],
  20. 'created'=>date("Y-m-d H:i:s"),
  21. );
  22.  
  23. $data['id']=$this->Question_model->add_data($data);
  24. $data['authority'] = $this->Question_model->getAuthority();
  25. if($this->input->post('share')=="yes"){
  26. $this->load->view('header',$data);
  27. $this->load->view('questions/share',$data['id']);
  28. $this->load->view('footer');
  29. }
  30. }
Add Comment
Please, Sign In to add comment