title: How to show validation errors using redirect in codeigniter?
body: <p>I have been dealing with a problem for a while. How can I set the validation errors using redirect in a function? This is the code I have in my controller :</p>
  
  <pre><code>function send()
  {
      $this-&gt;form_validation-&gt;set_rules('e-mail', 'Email', 'trim|required|valid_email');
      $this-&gt;form_validation-&gt;set_rules('cellphone', 'Cellphone Number', 'trim|required|is_natural');
      $this-&gt;form_validation-&gt;set_message('required', '%s is required.');
      $this-&gt;form_validation-&gt;set_message('valid_email', '%s is not a valid Email Address');
      $this-&gt;form_validation-&gt;set_message('is_natural', '%s can only contain numbers.');
      $this-&gt;form_validation-&gt;set_error_delimiters('&lt;li&gt;', '&lt;/li&gt;');
  
      if($this-&gt;form_validation-&gt;run() == FALSE)
      {
          redirect ('/');
      }
      else
      {
          echo '&lt;pre&gt;';
          print_r($_POST);
          echo '&lt;pre&gt;';
      }
  }
  </code></pre>
  
  <p>And this is the code I use in my view file:</p>
  
  <pre><code>&lt;? if (validation_errors())
  {   
  echo '&lt;div id="validation_errors" title="Error:"&gt;';
  echo '&lt;div class="response-msgs errors ui-corner-all"&gt;&lt;span&gt;Errors:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;';
  echo validation_errors();
  echo '&lt;/ul&gt;&lt;/div&gt;';
  echo '&lt;/div&gt;';
  }
  ?&gt;
  </code></pre>