How to Retrieve session id |
login.php
<?php class Login extends MY_Controller { public function index() { $this->load->view('login_view'); } public function user_login() { $this->form_validation->set_error_delimiters('<p class="text-danger">','</p>'); if($this->form_validation->run('login_rules')) { $email = $this->input->post('uemail'); $password = $this->input->post('upassword'); $this->load->model('loginmodel'); $login_id = $this->loginmodel->login_valid($email, $password); if($login_id) { $this->session->set_userdata('user_id', $login_id); return redirect('admin/dashboard'); } else { echo "password do not match."; } } else { $this->load->view('login_view'); } } } ?> ---------------------------------------------------------------------------------------------------------------------------------------------------------- propertymodel.php <?php class Propertymodel extends CI_Model { public function property_list() { $user_id = $this->session->userdata('user_id'); $query = $this->db ->select('prop_name') ->from('properties') ->where('user_id', $user_id ) ->get(); return $query->result(); } } ?> |
Messages In This Thread |
How to Retrieve session id - by Pankaj Kumar - 03-09-2018, 03:20 AM
RE: How to Retrieve session id - by donpwinston - 03-09-2018, 10:11 AM
RE: How to Retrieve session id - by InsiteFX - 03-09-2018, 01:50 PM
RE: How to Retrieve session id - by Pankaj Kumar - 03-14-2018, 03:14 AM
RE: How to Retrieve session id - by danielcr_2018 - 03-14-2018, 05:26 PM
RE: How to Retrieve session id - by Pankaj Kumar - 03-15-2018, 04:31 AM
RE: How to Retrieve session id - by InsiteFX - 03-15-2018, 06:30 AM
|