Discussion: Is this the best way?
Afficher un message
Vieux 14/03/2008, 19h02   #4
Richard Heyes
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Is this the best way?

> $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
  Réponse avec citation
 
Page generated in 0,04868 seconds with 9 queries