title: MVC: Retrieving value from input from view to controller
body: <p>I know it might seem a repeated problem. But i have created this form and i want to get the value of the email field in order to generate it to qr code 
  so this is the view </p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="col-md-6 col-md-offset-3"&gt;
          &lt;div class="panel panel-default"&gt;
              &lt;div class="panel-heading"&gt;
                  &lt;h4&gt;Registration form&lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="panel-body"&gt;
                  &lt;?php $attributes = array("name" =&gt; "registrationform");
                  echo form_open("user/register", $attributes);?&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label for="name"&gt;First Name&lt;/label&gt;
                      &lt;input class="form-control" id="fname" name="fname" placeholder="Your First Name" type="text" value="&lt;?php echo set_value('fname'); ?&gt;" /&gt;
                      &lt;span class="text-danger"&gt;&lt;?php echo form_error('fname'); ?&gt;&lt;/span&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;label for="name"&gt;Last Name&lt;/label&gt;
                      &lt;input class="form-control" name="lname" placeholder="Last Name" type="text" value="&lt;?php echo set_value('lname'); ?&gt;" /&gt;
                      &lt;span class="text-danger"&gt;&lt;?php echo form_error('lname'); ?&gt;&lt;/span&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;label for="email"&gt;Email ID&lt;/label&gt;
                      &lt;input class="form-control" id="email" name="email" placeholder="Email-ID" type="text" value="&lt;?php echo set_value('email'); ?&gt;" /&gt;
                      &lt;span class="text-danger"&gt;&lt;?php echo form_error('email'); ?&gt;&lt;/span&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;label for="subject"&gt;Password&lt;/label&gt;
                      &lt;input class="form-control" name="password" placeholder="Password" type="password" /&gt;
                      &lt;span class="text-danger"&gt;&lt;?php echo form_error('password'); ?&gt;&lt;/span&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;label for="subject"&gt;Confirm Password&lt;/label&gt;
                      &lt;input class="form-control" name="cpassword" placeholder="Confirm Password" type="password" /&gt;
                      &lt;span class="text-danger"&gt;&lt;?php echo form_error('cpassword'); ?&gt;&lt;/span&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;button name="submit" type="submit" class="btn btn-default"&gt;Signup&lt;/button&gt;
                      &lt;button name="cancel" type="reset" class="btn btn-default"&gt;Cancel&lt;/button&gt;
                  &lt;/div&gt;
                  &lt;?php echo form_close(); ?&gt;
                  &lt;?php echo $this-&gt;session-&gt;flashdata('msg'); ?&gt;
            &lt;/div&gt;
            &lt;/div&gt;
           &lt;/div&gt;
  </code></pre>
  
  <p>The controller: 
  This is a function that inserts data into the data base and it redirects to another function (successInsert)</p>
  
  <pre><code>function register()
      {
          //set validation rules
          $this-&gt;form_validation-&gt;set_rules('fname', 'First Name', 'trim|required|alpha|min_length[3]|max_length[30]');
          $this-&gt;form_validation-&gt;set_rules('lname', 'Last Name', 'trim|required|alpha|min_length[3]|max_length[30]');
          $this-&gt;form_validation-&gt;set_rules('email', 'Email ID', 'trim|required|valid_email|is_unique[user.email]');
          $this-&gt;form_validation-&gt;set_rules('password', 'Password', 'trim|required|matches[cpassword]|md5');
          $this-&gt;form_validation-&gt;set_rules('cpassword', 'Confirm Password', 'trim|required|md5');
  
          //validate form input
          if ($this-&gt;form_validation-&gt;run() == FALSE)
          {
              // fails
              $this-&gt;load-&gt;view('user_registration_view');
          }
          else
          {
              //insert the user registration details into database
              $data = array(
                  'fname' =&gt; $this-&gt;input-&gt;post('fname'),
                  'lname' =&gt; $this-&gt;input-&gt;post('lname'),
                  'email' =&gt; $this-&gt;input-&gt;post('email'),
                  'password' =&gt; $this-&gt;input-&gt;post('password')
              );
  
              // insert form data into database
              if ($this-&gt;User_model-&gt;insertUser($data))
              {
                  redirect('user/successInsert');
           }
  }
  
  
  
      function successInsert()
              {
                  $data['email'] = $this-&gt;input-&gt;post("email");  
                  $this-&gt;load-&gt;view('successful',$data);
              }
  </code></pre>
  
  <p>//This function redirects to view called successful only with the email
  And yet i still can't echo the email. Any help please.</p>