私はいくつかのトラップを入れようとしましたが、動作しませんでした。間違ったユーザー名とパスワードでログインできます。これにはどのような解決策がありますか?ユーザー名とパスワードのエラー処理
foreach ($result as $row) {
$acc_username=$row['acc_username'];
$acc_password=$row['acc_password'];
$acc_tableid=$row['table_id'];
}
if ($result == 0){
echo '
<div class="alert alert-danger">
<strong>Danger!</strong> This alert box could indicate a dangerous or potentially negative action.
</div>';
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.location.href='tableLogin.php';
</SCRIPT>");
}
else{
$_SESSION['table_number'] = $_POST['Make'];
$_SESSION['table_idd'] = $row['table_id'];
header("Location: customerLogin.php");
}
$update = "UPDATE tables SET login_status=1 WHERE table_id= $table_id";
if(mysql_query($update)){
}
}catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
} ?>
は、あなたもあなたのDBクエリを投稿することができます。 –
$ stmt = $ conn-> prepare( "SELECT account.acc_username、account.acc_password、tables.table_id FROM account INNER JOIN tables on tables.table_id = account.table_idここでtables.table_number = '$ makerValue' AND account.acc_username = '$ uname' AND account.acc_password = '$ pword' "); $ stmt-> execute(); $結果= $ stmt-> fetchAll(PDO :: FETCH_ASSOC); –