我与 CI有过一些可兑换之处,即使用thi和gt;拥有和开发;用户数据。
主计长
public function check_login()
{
$email = $this->input->post( username_email );
$password = $this->input->post( passwords );
$password_encrypt = sha1(md5($password));
$query = $this->model->check_login($email,$password_encrypt);
if( $query->num_rows() > 0 )
{
$row = $query->row(1);
$data = array(
email => $row->email,
level_id => $row->level_id,
id_subunit => $row->id_subunit,
);
$this->session->set_userdata($data);
return TRUE;
}
else{
return FALSE;
}
}
示范法
function check_login($email,$password_encrypt)
{
$db = $this->load->database( default ,TRUE);
$where_email = array( email => $email, password => $password_encrypt);
$db->where($where_email);
$query = $db->get( admin ,1);
return $query;
}
我试图在这里获得会议数据。
public function home()
{
$data[ level ] = $this->session->userdata( level_id );
$data[ email ] = $this->session->userdata( email );
$data[ id_subunit ] = $this->session->userdata( id_subunit );
if($data[ level ] == 1){
redirect( admin );
}
else if($data[ level ] == 2){
redirect( kuesioner/submited );
}
/*else{
redirect( sub_unit/home );
}*/
}
我的问题是,从届会的阵列中获取电子邮件和等级。
如何解决这一问题?