[eluser]svkonur[/eluser]
hi guys im newbie in codeigniter. Im trying to create a session for user login but i cant do it. Session library auto loaded.
here is my codes i hope there is someone to help me asap. Regards.
Code:
if($this->form_validation->run()){
$user_name = $this->input->post('user_name',TRUE);
$user_pass = md5($this->input->post('user_pass',TRUE));
try{
$_control = $this->admin_model->check_user($user_name,$user_pass);
if($_control != 0){
//$ses_arr = array("user_name" => $_control[0]["user_name"]);
try{
if($this->session->set_userdata("user_name" , $_control[0]["user_name"])){
redirect('admin');
}else{
throw new Exception('Oturum açma sorunu gerçekleşti.');
}
}
catch(Exception $ses_excp){
echo '<div class="alert alert-error"><button data-dismiss="alert" class="close" type="button" title="Kapat">×</button><center>'.$ses_excp->getMessage().'</center></div>';
}
}else{
throw new Exception('Kullanıcı Bulunamadı!');
}
}
catch(Exception $user_excp){
echo '<div class="alert alert-error"><button data-dismiss="alert" class="close" type="button" title="Kapat">×</button><center>'.$user_excp->getMessage().'</center></div>';
}
}