Welcome Guest, Not a member yet? Register   Sign In
Login
#5

[eluser]Felipe Deitos[/eluser]
hehehe Last one... here we go!
I got my header and footer views inside a folder called includes...
On submit the form it calls 'includes/validate_user'

This is my includes controller:
Code:
<?php

class Includes extends CI_Controller {

public function validate_user()
{
  $this->load->model('users_model');
  $query = $this->users_model->validate();
  
  if($query)
  {
   $data = array(
    'usuario' => $this->input->post('usuario'),
    'is_logged' => true
   );
  
   $this->session->set_userdata($data);
   redirect('?????'); //WHERE
  }
  else
  {
   redirect('?????'); //WHERE
  }
}

}

/* End */

This is my users_model:
Code:
<?php

class Users_model extends CI_Model {

public function validate()
{
  $this->db->where('usuario', $this->input->post('usuario'));
  $this->db->where('senha', md5($this->input->post('senha')));
  $query = $this->db->get('usuarios');
  
  if($query->num_rows == 1)
  {
   return true;
  }
}

}

/* End */


How can i use this redirect to return to the page that i was viewing?


Messages In This Thread
Login - by El Forum - 07-11-2012, 09:58 AM
Login - by El Forum - 07-11-2012, 10:24 AM
Login - by El Forum - 07-11-2012, 11:16 AM
Login - by El Forum - 07-11-2012, 11:41 AM
Login - by El Forum - 07-11-2012, 11:55 AM
Login - by El Forum - 07-11-2012, 12:08 PM
Login - by El Forum - 07-11-2012, 12:25 PM
Login - by El Forum - 07-11-2012, 12:33 PM
Login - by El Forum - 07-11-2012, 12:39 PM
Login - by El Forum - 07-11-2012, 01:42 PM
Login - by El Forum - 07-11-2012, 01:46 PM
Login - by El Forum - 07-12-2012, 04:19 AM
Login - by El Forum - 07-12-2012, 10:52 AM
Login - by El Forum - 07-12-2012, 12:05 PM
Login - by El Forum - 07-12-2012, 12:12 PM
Login - by El Forum - 07-12-2012, 12:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB