adam84 Posted June 12, 2008 Share Posted June 12, 2008 Ok, I try to login in, my one php file calls the session file with the userID. The for some reason nothing happens. I know I get into the session part of the If state. Am I on the right track? Session Class <? class session { var $logged_in; var $uID; function session(){ session_start(); $this->logged_in = false; $this->uID = -1; } function setLogin( $userID ){ $this->logged_in = true; $this->uID = $userID; } function logout(){ $this->logged_in = false; $this->uID = -1; } } ?> PHP file <? include("session.php"); ~~ sql statement to check login ~~ if( mysql_num_rows( $r ) > 0 ){//login in, create session $row = mysql_fetch_row( $r ); $sess = new session(); $sess->setLogin( $row[0] ); //row[0] = userID return true; }else{//error return false; } ?> Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted June 13, 2008 Share Posted June 13, 2008 what is it that you want to happen by the way? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 13, 2008 Share Posted June 13, 2008 Why are you using deprecated OOP syntax? And why do you have a class like that? It's too coupled. You need to separate it into meaningful parts. Learn about OOP before you try and use it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.