Bien au dessus de Léandre et JL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
838 B

<?php
if (isset($_POST["username"]) && isset($_POST["password"])) {
$bdd = new SQLite3('../users.db', SQLITE3_OPEN_READWRITE);
$request = $bdd->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 '<meta http-equiv="refresh" content="0;URL=../jeu/index.php">';
exit;
}
else {
echo '<meta http-equiv="refresh" content="0;URL=login.php?error=3">';
exit;
}
}
echo '<meta http-equiv="refresh" content="0;URL=login.php?error=2">';
}
?>