如果用戶輸入的憑證不正確(不會返回與我的數據庫中的任何內容匹配的內容),例如在登錄表單中,則向用戶顯示錯誤消息。 這樣做最簡單的方法是什麼? 這是我必須在之前NOW-在PHP中顯示錯誤消息
<?php
require 'includes/common.php';
?>
<!DOCTYPE html>
<!--
Login page of Lifestyle Store
-->
<html>
<head>
<title>Log In</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!---- External css file index.css placed in the folder css is linked-->
<link href="css/index.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<?php
include 'includes/header.php';
?>
<div class="row login">
<div class="col-xs-4"></div>
<div class="col-xs-4">
<div class="panel panel-primary">
<div class="panel-body">
<p class="text-warning">Login to make a purchase-</p>
<form action="login_submit.php" method="POST">
<div class="form-group">
<label for="email">E-mail:</label>
<input type="text" class="form-control" name="email" value="Email">
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="text" class="form-control" name="password" value="Password">
</div>
</form>
<button class="btn btn-primary" type="submit" name="submit">Log-in</button>
</div>
<div class="panel-footer">Don't have an account? <a class="a2" href="signup.html">Register!</a></div>
</div>
</div>
<div class="col-xs-4"></div>
</div>
<?php
include 'includes/footer.php';
?>
</body>
所以在這裏你有什麼張貼您的問題迄今爲止嘗試過。 – lkdhruw
@gp_sflover好的。未來將把所有這一切銘記在心! – Vaibhav