query('SELECT * from users');
while($line = $request->fetchArray()) {
if ($line['username'] == $_POST["username"]) {
echo '';
exit;
}
}
$append = $bdd->prepare("INSERT INTO users(username, password, compte) VALUES(:username, :password, :compte)");
$append->bindValue(':username', $_POST['username']);
$append->bindValue(':password', sha1($_POST['password']));
$append->bindValue(':compte', 100);
$append->execute();
session_start();
$_SESSION['username'] = $line['username'];
$_SESSION['password'] = $line['password'];
$_SESSION['compte'] = $line['compte'];
echo '';
}
?>