query("SELECT * FROM users where username='".$_POST['username']."'"); while($line = $request->fetchArray()) { if ($line["password"] == sha1($_POST["password"])) { session_start(); $_SESSION['username'] = $line['username']; $_SESSION['password'] = $line['password']; $_SESSION['compte'] = $line['compte']; echo ''; exit; } else { echo ''; exit; } } echo ''; } ?>