title: How to clear form data after submission?
body: <p>I have form with a file input in my CodeIgniter website. When I fill in the form and click the submit button it's working fine. However, when I refresh the browser the same form data is uploaded again. How can I prevent this ?</p>
  
  <p>input form</p>
  
  <pre><code>&lt;form name="image_upload" action="&lt;?= base_url() ?&gt;admin/image_move_upload" method="post" accept-charset="utf-8" enctype="multipart/form-data"&gt;  
      &lt;ul&gt;  
          &lt;li class="ui-field"&gt;&lt;label for="filename"&gt;File Name :&lt;/label&gt;&lt;/li&gt;
          &lt;li class="ui-input"&gt;&lt;input type="text"  name="filename" placeholder=""&gt;&lt;/li&gt;  
          &lt;li class="ui-field"&gt;&lt;label for="file"&gt;Image( *only .jpg) :&lt;/label&gt;&lt;/li&gt; 
          &lt;li class="ui-input"&gt;&lt;input type="file" name="imagefile" value="" placeholder="" required=""&gt;&lt;/li&gt;  
          &lt;li&gt;&lt;input type="submit"  name="Upload" class="ui-submit"&gt;&lt;/li&gt;  
      &lt;/ul&gt;  
  &lt;/form&gt;
  </code></pre>
  
  <p>controller section</p>
  
  <pre><code>function image_move_upload() {
      $data['errors'] = NULL;
      $data['success'] = NULL;
  
      if (isset( $_POST['Upload'] )) {
        $config_arr = array(
              'upload_path' =&gt; './uploads/slider/',
              'allowed_types' =&gt; 'jpg',
              'max_size' =&gt; '2048',
              'max_width' =&gt; '1024',
              'max_height' =&gt; '768',
              'encrypt_name' =&gt; true,
              'file_name'  =&gt; 'sanji.jpg',
          );
          $this-&gt;load-&gt;library('upload', $config_arr);
          if (!$this-&gt;upload-&gt;do_upload('imagefile')) {
              $data['errors'] = $this-&gt;upload-&gt;display_errors(); // this isn't working                
          } else {
              $data['qs'] = $this-&gt;upload-&gt;data();
              $data['success'] = "File Uploaded Successfully";
          }         
      }
  
      $data['main_content'] = 'admin/upload';
      $this-&gt;load-&gt;view('admin_layout', $data);
  }
  </code></pre>