CodeIgniter Forums
Controller Question Here Again.. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Controller Question Here Again.. (/showthread.php?tid=27564)



Controller Question Here Again.. - El Forum - 02-14-2010

[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');
}

}


}



Smile


Controller Question Here Again.. - El Forum - 02-14-2010

[eluser]mikelbring[/eluser]
You have an extra } right after echo "allright";