0
我期待創建一個登錄頁面,只有註冊用戶才能登錄。我試過下面的代碼,但它不工作。我提到了我的存儲過程以及我的登錄頁面代碼。如何僅通過登錄頁面接受註冊用戶
create procedure cp(in username,in password,out yes_no)
BEGIN
SELECT count(*) INTO yes_no
FROM user1 u
WHERE u.USERNAME = username && u.PWD = password_p;
END
<body>
<h2>Login Form</h2>
<form action="/action_page.php">
<div class="container">
<label><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Login</button>
<input type="checkbox" checked="checked"> Remember me
</div>
<div class="container" style="background-color:#f1f1f1">
<button type="button" class="cancelbtn">Cancel</button>
<span class="psw">Forgot <a href="#">password?</a></span>
</div>
</form>
</body>
</html>
<?php
$connection = mysqli_connect("localhost", "root", "", "seb");
$result = mysqli_query($connection,
"CALL cp") or die("Query fail: " . mysqli_error());
?>