Welcome Guest, Not a member yet? Register   Sign In
session site&forum;
#1

[eluser]benfike[/eluser]
I have an own made site.

And i have an forum from this forum, this -> http://codeigniter.com/wiki/Forum_writte...deIgniter/

I want, if anyone login on my site, that will login forums too.

Code:
function verifyUser($u,$pw){
        $this->db->select('id,username');
        $this->db->where('username',$u);
        $this->db->where('password',md5($pw));
        $this->db->where('status','active');
        $this->db->limit(1);
        $Q = $this->db->get('users');
        if($Q->num_rows() > 0){
            $row = $Q->row_array();
            $_SESSION['user_id'] = $row['id'];
            $_SESSION['id'] = $row['id'];
            $_SESSION['username'] = $row['username'];
        }else{
            $this->session->set_flashdata('error', 'Hibás felhasználónév vagy jelszó!');
        }
        $Q->free_result();
    }

And in the install.txt - > "set your auth system to create $this->session->userdata('username') as the
username from the database, and $this->session->userdata('id') as the users
id, and $this->session->userdata('admin') for users that match an
administrative role."

What i need to do with this? help me please
#2

[eluser]mohamedhelal[/eluser]
i think you mast use and where function db




Theme © iAndrew 2016 - Forum software by © MyBB