• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controller Question Here Again..

#1
[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

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.