PHP login to database problem
problem im having is when i or anyone types in their user and pass into my site (user and pass also link to a sql database) it wont return any error it just says "you must be logged in to do this" heres my login.php i have spent the last two days trying to tackle it before asking for help <?php # login if (!defined('KODEVS') || KODEVS != 1) die(); class Page extends BasePage { function doStartup() { $this->setTitle('PAGE_LOGIN_TITLE'); $this->disableCache(); } function doRun() { $user = $this->doSanitizeName(@ $_POST['userid'], 20); $pass = $this->doHashPassword(@$_POST['passwd']); $db = $this->getADB(); $result = mysqli_num_rows($num_rows); $num_rows = $db->doQuery("SELECT strAccountID, strPasswd, strAuthority FROM TB_USER WHERE strAccountID ='$user' AND strPasswd ='$pass'"); if ($db->hasError()) { $this->doError('DB_ERROR'); return; } else if (!$db->hasRows()) { $this->doError('LOGIN_FAILED'); return; } $row = $db->doRead(); if ($row['strAuthority'] == 255) { $this->doError('LOGIN_BANNED'); return; } $_SESSION = array_merge($_SESSION, $row); $_SESSION['bLoggedIn'] = TRUE; $_SESSION['IP'] = $this->getRemoteIP(); header('Location: ./?page=account'); } } ?> not sure at this point where i wwent wrong