Guest User

Untitled

a guest
Jul 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <form action="/merchant/process_create" method="post" id="merchant_signup" enctype="multipart/form-data">
  2. <?php
  3. echo form_label('Select Your Logo or Relevant Image:', 'image');
  4. echo "<br />";
  5. ?>
  6. <input type="file" name="image" size="20" id="image" />
  7. <?php
  8. echo "<br />";
  9. echo "<br />";
  10.  
  11. echo form_submit('submit', 'Create Account');
  12. ?>
  13.  
  14. //upload the image
  15. $config['upload_path'] = $_SERVER['DOCUMENT_ROOT'] . '/uploads/';
  16. $config['allowed_types'] = 'jpg|jpeg|gif|png';
  17. $config['max_size'] = '2000';
  18. $config['max_width'] = '0';
  19. $config['max_height'] = '0';
  20. $config['file_name'] = time() . rand();
  21. $config['remove_spaces'] = TRUE;
  22.  
  23. $this->load->library('upload', $config);
  24.  
  25. if ( ! $this->upload->do_upload('image'))
  26. {
  27. $data= array('error' => $this->upload->display_errors('', '<br />'));
  28.  
  29. //reload the view
  30. $this->load->view('header');
  31.  
  32. $this->load->view('merchant_create_form', $data);
  33.  
  34. $this->load->view('footer');
  35.  
  36. } else {
  37.  
  38. //make the insert array
  39. $merchant_data = array(
  40. 'user_id' => $this->session->userdata('user_id'),
  41. 'name' => $this->input->post('name'),
  42. 'uri_slug' => $this->input->post('uri_slug'),......
  43.  
  44. // $config['file_name'] = time() . rand();
Add Comment
Please, Sign In to add comment