CodeIgniter Forums

Full Version: Controller Question Here Again..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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

El Forum

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