title: Redirect , POST and Flashdata issue in Codeigniter
body: <p>i am developing an application where i need some suggestions. Here is the detail of the problem.</p>
  
  <pre><code>public function form()
  {
      $this-&gt;load-&gt;helper('inflector');
      $id =   $this-&gt;uri-&gt;segment(3,0); 
  
      if($data = $this-&gt;input-&gt;post()){
          $result =   $this-&gt;form_validation-&gt;run();
          if($result){
              if($id &gt; 0){
                // here update code
              }else{
                  $this-&gt;mymodel-&gt;insert($data);
                  $this-&gt;session-&gt;set_flashdata('message','The page has been added successfully.');
                  $this-&gt;redirect =   "mycontroller/index";
                  $this-&gt;view     =   FALSE;
              }
          }else{
              //$this-&gt;call_post($data);
              $this-&gt;session-&gt;set_flashdata('message','The Red fields are required');
              $this-&gt;view     =   FALSE;
              $this-&gt;redirect =   "mycontroller/form/$id";
          }
      }else{
  
          $row    =   $this-&gt;mymodel-&gt;fetch_row($id);
          $this-&gt;data[]=  $row;
      }
  }
  
  
  public function _remap($method, $parameters)
  {
      if (method_exists($this, $method))
      {
          $return =   call_user_func_array(array($this, $method),$parameters);
      }else{
          show_404();
      }
  
      if(strlen($this-&gt;view) &gt; 0)
      {
          $this-&gt;template-&gt;build('default',array());
  
      }else{
          redirect($this-&gt;redirect);
      }   
  }   
  </code></pre>
  
  <p>Here you can see how i am trying to reload the page on failed validation. 
  Now the problem is that i have to display the flash data on the view form which is only available after redirect and i need to display the validation errors to which are not being displayed on redirect due to the loss of post variable. If i dont use redirect then cant display flashdata but only validation errors. I want both of the functionalities togather. I have tried even creating POSt again like this</p>
  
  <pre><code>public function call_post($data)
  {
      foreach($data as $key =&gt; $row){
          $_POST[$key]    =   $row;
      }   
  }
  </code></pre>
  
  <p>Which i commented out in the formmethod.How can i achieve this.</p>