CodeIgniter Forums
Controller Question Here Again.. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Controller Question Here Again.. (/thread-27564.html)



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";