[eluser]napz[/eluser]
Hi Ci Master.... I have this controller below, wherein I want to input the password and username, if it is correct echo "allright" if it is not correct go back again to empin.php view. Hmmmm it works however the URL generate like "http://localhost/mysite/empin/empin/login".... as you can see it doubles the empin class.. how can I fix this problem?
class Empin extends Controller {
function index()
{
$this->load->view('empin');
}
function login()
{
$data['username'] = $this->input->post('username');
$data['password'] = $this->input->post('password');
$sql = "SELECT * from companyinfo WHERE userName =? AND passWord=?";
$query = $this->db->query($sql, array($data['username'],$data['password']));
if($query->num_rows() > 0 ){
echo "allright";
}
}else{
$this->load->view('empin');
}
}
}