Welcome Guest, Not a member yet? Register   Sign In
Form validation error message issues
#11

[eluser]RalphLeMouf[/eluser]
Ok - First off I want to thank you for all of your time in this matter, and secondly I'm getting sadder by the minute because I'm so close and just not understanding what the problem is.

I have taken your advice on restructuring based off of the user guide, however some errors are posting as they should:

when you submit the form with out touching any fields, it runs the correct errors, and when you enter a correct email and don't touch pw field, it runs the correct error but when you put in incorrect information with any other incorrect information it loads a white page

I have used the profiler on those pages and the query is running correctly and the fields are being populated correctly and I can log in with out a problem when the correct info is sent.

This is what I have right now:

Code:
<?php
    
echo form_open('auth/validate_credentials_login');
echo "<span class='errors_login'>";
echo form_error('email_login');
echo "</span>";
echo form_label('', 'Email', 'email_login');
$data = array( 'name' => 'email_login', 'class' => 'input', 'placeholder' => 'Email');
echo form_input($data, set_value('email_login'));
echo "<span class='errors_login'>";
echo form_error('password_login');
echo form_label('', 'Password;', 'password_login');
$data = array( 'name' => 'password_login', 'class' => 'input', 'placeholder' => 'Password');
echo form_submit('submit_login', 'Login');
echo form_close();
?&gt;

Code:
function validate_credentials_login()
  {
  
   $this->load->helper(array('form','url'));
   $this->load->library('session');
   $this->load->model('user_model', 'um');
   $this->load->library('encrypt');
   $this->load->library('form_validation');
   $this->form_validation->set_rules('email_login', 'Email', 'required');
   $this->form_validation->set_rules('password_login', 'Password', 'required');
   $login = $this->input->post('submit_login');
  
  
   if ($this->form_validation->run() == FALSE)
     {
      $data['main_content'] = 'home/home_page';
      $this->load->view('includes/templates/home_page_template', $data);
     }
   else
  
   {
    
    if($login) {
    $user = $this->um->validate_home_login(array('email' => $this->input->post('email_login')));
    if( $user ) {

     // CHECK THE USER'S PASSWORD AGAINST THE ONE FROM THE LOGIN FORM
     if($user->password == $this->encrypt->sha1( $user->salt . $this->encrypt->sha1($this->input->post('password_login')))) {
      $this->session->set_userdata(array(
       'email' => $this->input->post('email_login')
      ));
      redirect('account/edit');
      exit;
    
     }
    }
   }
  
  }

}


Messages In This Thread
Form validation error message issues - by El Forum - 10-04-2012, 10:47 AM
Form validation error message issues - by El Forum - 10-04-2012, 01:57 PM
Form validation error message issues - by El Forum - 10-04-2012, 04:22 PM
Form validation error message issues - by El Forum - 10-05-2012, 12:38 PM
Form validation error message issues - by El Forum - 10-05-2012, 01:09 PM
Form validation error message issues - by El Forum - 10-05-2012, 01:13 PM
Form validation error message issues - by El Forum - 10-05-2012, 04:24 PM
Form validation error message issues - by El Forum - 10-05-2012, 09:12 PM
Form validation error message issues - by El Forum - 10-07-2012, 11:17 AM
Form validation error message issues - by El Forum - 10-07-2012, 03:39 PM
Form validation error message issues - by El Forum - 10-08-2012, 02:32 PM
Form validation error message issues - by El Forum - 10-08-2012, 03:33 PM
Form validation error message issues - by El Forum - 10-08-2012, 06:51 PM
Form validation error message issues - by El Forum - 10-08-2012, 09:56 PM
Form validation error message issues - by El Forum - 10-09-2012, 10:08 AM
Form validation error message issues - by El Forum - 10-11-2012, 09:08 AM
Form validation error message issues - by El Forum - 10-11-2012, 09:54 AM
Form validation error message issues - by El Forum - 10-11-2012, 12:01 PM
Form validation error message issues - by El Forum - 10-11-2012, 12:51 PM
Form validation error message issues - by El Forum - 10-11-2012, 01:58 PM
Form validation error message issues - by El Forum - 10-11-2012, 02:23 PM
Form validation error message issues - by El Forum - 10-15-2012, 09:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB