CodeIgniter Forums
session site&forum; - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: session site&forum; (/thread-21638.html)



session site&forum; - El Forum - 08-16-2009

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

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

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


session site&forum; - El Forum - 08-16-2009

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