Re: Is this the best way?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$rowcnt = mysqli_num_rows($loginResult);
if($rowcnt !="1"){
            echo "Auth failed";
            die("Auth failed... Sorry");
}else{
            while($row1 = mysqli_fetch_array($loginResult)) {
                $_SESSION['user'] = $row1['loginName'];
                $_SESSION['loggedin'] = "YES";

Eww. Use booleans:

$_SESSION['loggedin'] = true;

                $table = $row1['tableName'];
                $adminLevel = $row1['adminLevel'];
                $authenticated = "TRUE";

Like above, I would advise using booleans (true/false) and not strings (text):

$authenticated = true; // Note the lack of quote marks

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux