title: how to store multiple form data and send them to next view?
body: <p>I am using codeigniter.I am having three different tab window where I have seperate form in each page. I need to store my first form content and post them to controller from second content. Similarly on third page after filling those content I need to insert them on the table in my database.
  This is my controller page.</p>
  
  <pre><code>&lt;?php
  class Admin_employee extends CI_Controller {
  
      public function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;model('employee_model');
      $this-&gt;load-&gt;model('add_service_model');
          $this-&gt;load-&gt;model('designation_model');
  
          if(!$this-&gt;session-&gt;userdata('is_logged_in')){
              redirect('admin/login');
          }
      }
       public function index()
      {
          $this-&gt;load-&gt;library('session');
          $this-&gt;session-&gt;unset_userdata('tax_details');
          //all the posts sent by the view
          $manufacture_id = $this-&gt;input-&gt;post('category');        
          $search_string = $this-&gt;input-&gt;post('search_string');        
          $order = $this-&gt;input-&gt;post('order'); 
          $order_type = $this-&gt;input-&gt;post('order_type'); 
  
          //pagination settings
          $config['per_page'] = 999999;
          $config['base_url'] = base_url().'admin/employee';
          $config['use_page_numbers'] = TRUE;
          $config['num_links'] = 20;
          $config['full_tag_open'] = '&lt;ul&gt;';
          $config['full_tag_close'] = '&lt;/ul&gt;';
          $config['num_tag_open'] = '&lt;li&gt;';
          $config['num_tag_close'] = '&lt;/li&gt;';
          $config['cur_tag_open'] = '&lt;li class="active"&gt;&lt;a&gt;';
          $config['cur_tag_close'] = '&lt;/a&gt;&lt;/li&gt;';
  
  
          //math to get the initial record to be select in the database
          $limit_end = ($page * $config['per_page']) - $config['per_page'];
          if ($limit_end &lt; 0){
              $limit_end = 0;
          } 
  
  
  
      }//index
  
  
      public function form1()
      {
  
          if ($this-&gt;input-&gt;server('REQUEST_METHOD') === 'POST')
          {
               $this-&gt;form_validation-&gt;set_rules('id', 'id');
  
              $this-&gt;form_validation-&gt;set_rules('emp_first_name', 'emp_first_name','required');
              $this-&gt;form_validation-&gt;set_rules('emp_last_name', 'emp_last_name','required');
              $this-&gt;form_validation-&gt;set_rules('emp_email_id', 'emp_email_id');
              $this-&gt;form_validation-&gt;set_rules('emp_emergency_contact', 'emp_emergency_contact');
              $this-&gt;form_validation-&gt;set_rules('category', 'category');
              $this-&gt;form_validation-&gt;set_rules('emp_id_card', 'emp_id_card');
  
              $this-&gt;form_validation-&gt;set_rules('emp_date_of_hire', 'emp_date_of_hire');
              $this-&gt;form_validation-&gt;set_rules('emp_date_of_termination', 'emp_date_of_termination');
              $this-&gt;form_validation-&gt;set_rules('emp_date_of_rehire', 'emp_date_of_rehire');
              $this-&gt;form_validation-&gt;set_rules('emp_reference_num', 'emp_reference_num');
              $this-&gt;form_validation-&gt;set_rules('emp_service_limitation', 'emp_service_limitation');
              $this-&gt;form_validation-&gt;set_rules('emp_active', 'emp_active');
              $this-&gt;form_validation-&gt;set_rules('chair_renter', 'chair_renter');
              $this-&gt;form_validation-&gt;set_error_delimiters('&lt;div class="alert alert-error"&gt;&lt;a class="close" data-dismiss="alert"&gt;×&lt;/a&gt;&lt;strong&gt;', '&lt;/strong&gt;&lt;/div&gt;');
  
              //if the form has passed through the validation
              if ($this-&gt;form_validation-&gt;run())
              {
                  $data_to_store = array(
                       'id' =&gt; $this-&gt;input-&gt;post('id'),
                      'emp_first_name' =&gt; $this-&gt;input-&gt;post('emp_first_name'),
                      'emp_last_name' =&gt; $this-&gt;input-&gt;post('emp_last_name'),
                      'emp_email_id' =&gt; $this-&gt;input-&gt;post('emp_email_id'),
                      'emp_emergency_contact' =&gt; $this-&gt;input-&gt;post('emp_emergency_contact'),          
                      'category' =&gt; $this-&gt;input-&gt;post('category'),
                      'emp_id_card' =&gt; $this-&gt;input-&gt;post('emp_id_card'),
                      'emp_time_in' =&gt; $this-&gt;input-&gt;post('emp_time_in'),
                      'emp_time_out' =&gt; $this-&gt;input-&gt;post('emp_time_out'),
                      'emp_date_of_hire' =&gt; $this-&gt;input-&gt;post('emp_date_of_hire'),
                      'emp_date_of_termination' =&gt; $this-&gt;input-&gt;post('emp_date_of_termination'),
                      'emp_date_of_rehire' =&gt; $this-&gt;input-&gt;post('emp_date_of_rehire'),
                      'emp_reference_num' =&gt; $this-&gt;input-&gt;post('emp_reference_num'),
                      'emp_service_limitation' =&gt; $this-&gt;input-&gt;post('emp_service_limitation'),
                      'chair_renter' =&gt; $this-&gt;input-&gt;post('chair_renter'),
  
                  );
  
  
  
          }
  
  
           if($this-&gt;employee_model-&gt;store_employee($data_to_store)){
                      $data['flash_message'] = TRUE; 
                      $this-&gt;session-&gt;set_flashdata('flash_message', 'updated');
                  }else{
                      $data['flash_message'] = FALSE; 
  
  
  
              }
  
          }
          $data['designation'] = $this-&gt;designation_model-&gt;get_designation();
          $data['main_content'] = 'admin/employee/add';
          $this-&gt;load-&gt;view('includes/template', $data);  
      } 
      public function form2()
      {
  if ($this-&gt;input-&gt;server('REQUEST_METHOD') === 'POST')
          {
               $this-&gt;form_validation-&gt;set_rules('id', 'id');
  
              $this-&gt;form_validation-&gt;set_rules('emp_active', 'emp_active');
              $this-&gt;form_validation-&gt;set_rules('chair_renter', 'chair_renter');
              $this-&gt;form_validation-&gt;set_error_delimiters('&lt;div class="alert alert-error"&gt;&lt;a class="close" data-dismiss="alert"&gt;×&lt;/a&gt;&lt;strong&gt;', '&lt;/strong&gt;&lt;/div&gt;');
  
              //if the form has passed through the validation
              if ($this-&gt;form_validation-&gt;run())
              {
                  $data_to_store = array(
                       'id' =&gt; $this-&gt;input-&gt;post('id'),
                           'emp_active' =&gt; $this-&gt;input-&gt;post('emp_active'),
                  'chair_renter' =&gt; $this-&gt;input-&gt;post('chair_renter'),
  
                  );
  
  
  
          }
  
  
           if($this-&gt;employee_model-&gt;store_employee($data_to_store)){
                      $data['flash_message'] = TRUE; 
                      $this-&gt;session-&gt;set_flashdata('flash_message', 'updated');
                  }else{
                      $data['flash_message'] = FALSE; 
  
  
  
              }
  
          }
  
      $data['main_content'] = 'admin/employee/service_limitations';
          $this-&gt;load-&gt;view('includes/template', $data);
      } 
  
  } 
  </code></pre>
  
  <p>Here I have 2 function. <code>form1</code> and <code>form2</code>. when I save my data in second form I need to insert the values from first form and second form. How to do it? Can someone help me code?</p>