Welcome Guest, Not a member yet? Register   Sign In
need help editing session lib?
#1

[eluser]steel_slasher[/eluser]
i want to edit the sessions lib so that it would not only check to see if the session id and useragent match but also if an email address has been assigned to that session id as i cannot think of any other to do it. After looking at the lib i figured this should be right.

Code:
if (isset($session['email']))
            {
                $check=$this->CI->db->simple_query("SELECT `session_id` FROM `ci_sessions` WHERE `email` = '{$session['email']}'");
                if($check=FALSE){
                $this->sess_destroy;
                return FALSE;
            }

i am not going to run it as it will probably lead to huge errors and i am not an expert on CI so i just want to get this code checked before i run it.
#2

[eluser]Seppo[/eluser]
simple_query won't return false if there is no result. Also you are assigning on the if condition.
#3

[eluser]steel_slasher[/eluser]
ok so i should change the query type and i dont understand what you mean by "assigning on the if condition"
#4

[eluser]Seppo[/eluser]
I mean that
[code]
if($check=FALSE){
//should be
if($check==FALSE){
#5

[eluser]steel_slasher[/eluser]
oh okay no i know what you mean so i will add that in after playing so FPS games on the Wii




Theme © iAndrew 2016 - Forum software by © MyBB