unidox Posted July 10, 2010 Share Posted July 10, 2010 I am making a CMS, and I have a /core/ folder, which contains all my classes for logging in and what not. Now, i am trying to use a class that sets a login session, inside the /admin/ directory. I dont know why, but the sessions are being set. Any ideas? index.php in /admin/: <?php session_start( ); // exit ( $_SESSION['userId'] ); include ("../config.php"); include ("../core/coreClass.php"); include ("../core/dbClass.php"); include ("../core/userClass.php"); define (IN_SCRIPT, true); $coreClass = new coreClass ( ); $dbClass = new dbClass ( $host, $username, $password, $table ); $userClass = new userClass ( ); if ( !$userClass->checkLoggedIn( ) ) { $currentPage = "login"; } elseif ( $coreClass->getGET("page") && file_exists ( "pages/".$coreClass->getGET("page").".php" ) ) { $currentPage = $coreClass->getGET("page"); } else { $currentPage = "home"; } @include ( "processors/".$currentPage.".php" ); include ( "pages/".$currentPage.".php" ); ?> Here is the function that is being called (I know its returning true) This is inside /core/: public function loginUser ( $username, $password ) { $username = coreClass::clean( $username ); $password = coreClass::encrypt( coreClass::clean( $password ) ); $query = dbClass::sql ( "users", "WHERE `username` = '$username' AND `password` = '$password' AND `isActive` = '1'" ); if ( mysql_num_rows( $query ) == 1 ) { $row = dbClass::get_row( $query ); $_SESSION['userId'] == $row['id']; $_SESSION['isLogged'] == 1; $_SESSION['isAdmin'] == $row['isAdmin']; $_SESSION['userLevel'] == $row['accessLevel']; return true; } else { return false; } } Quote Link to comment Share on other sites More sharing options...
unidox Posted July 10, 2010 Author Share Posted July 10, 2010 Never mind, im a moron haha. I used == instead of = 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.