title: CodeIgniter Form Validation Error Redirect to section page
body: <p>I have a page divided by sections, and last section have a form contact.</p>
  
  <p>My code form:</p>
  
  <blockquote>
  <pre><code>&lt;section id="contact"&gt;
  &lt;div class="contact_form"&gt;
          &lt;span class="form_settings"&gt;
              &lt;?php
              $this-&gt;load-&gt;helper("form");
              //echo $msg;
              //echo validation_errors();
  
              echo form_open("main/send_email");
              echo form_label("", "nome");
              $data = array(
                  "placeholder" =&gt; "Nome:",
                  "class" =&gt; "form_settings",
                  "name" =&gt; "nome",
                  "id" =&gt; "nome",
                  "value" =&gt; set_value("nome")
              );
              echo form_input($data);
              echo form_error('nome');
  
  
              echo form_label("", "email");
              $data = array(
                  "placeholder" =&gt; "Email:",
                  "class" =&gt; "form_settings",
                  "name" =&gt; "email",
                  "id" =&gt; "email",
                  "value" =&gt; set_value("email")
              );
              echo form_input($data);
              echo form_error('email');
  
  
              echo form_label("", "msg");
              $data = array(
                  "placeholder" =&gt; "Mensagem:",
                  "class" =&gt; "form_settings",
                  "name" =&gt; "msg",
                  "id" =&gt; "msg",
                  "value" =&gt; set_value("msg")
              );
              echo form_textarea($data);
              echo form_error('msg');
  
  
              echo form_submit("submit", "Enviar", "class='form_settings'");
              echo form_close();
              ?&gt;
  
          &lt;/span&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  </blockquote>
  
  <p>My Controller have a function send_email() :</p>
  
  <pre><code>public function send_email() {
      $this-&gt;load-&gt;library("form_validation");
      $this-&gt;form_validation-&gt;set_rules("nome", "Nome:", "required|alpha|xss_clean");
      $this-&gt;form_validation-&gt;set_rules("email", "Email:", "required|valid_email|xss_clean");
      $this-&gt;form_validation-&gt;set_rules("msg", "Mensagem:", "required|xss_clean");
  
      if ($this-&gt;form_validation-&gt;run() == FALSE) {
          redirect('main/contactPage#contact');
      } else {
  
          $this-&gt;load-&gt;library("email");
          $this-&gt;email-&gt;from(set_value("email"), set_value("nome"), set_value("msg"));
          $this-&gt;email-&gt;to("xxx@gmail.com");
          $this-&gt;email-&gt;subject("Mensagem");
          $this-&gt;email-&gt;message(set_value("msg"));
  
          $this-&gt;email-&gt;send();
          $data["msg"] = "Email enviado com sucesso!";
          //echo $this-&gt;email-&gt;print_debugger();
          redirect('main/contactPage#contact', $data);
  
          }
      }
  </code></pre>
  
  <p>If form error, it redirects to section page but doesn't show the validation errors.
  If correct form, it redirects to section page but doesn't show the value of $data.</p>
  
  <p>Any solution for this?</p>
  
  <p>Tks!</p>