我正在尋找一種方法來檢查用戶是否輸入了某些內容到登錄腳本中。我試過 if (!empty($_POST))
但這種方法失敗。由於我是PHP新手,我不確定使用其他乾淨的方法。登錄帖子錯誤
<?php
if (!empty($post)){
header("Location:login.php");
echo"Invalid Username or Password";
}
?>
<html>
<head>
<title>Administrator Login Page</title>
<style type="text/css">
@import "style.css";
</style>
</head>
<body>
<h1>Administrator Login Page</h1>
</br></br></br></br></br></br></br>
<form action="admin_verify.php" method="post">
User Name:
<input type="text" name="admin_name" />
</br></br>
Password:
<input type="password" name="admin_password" />
</br></br>
<input type="submit" value="Login"/>
<input type="reset" value="Reset"/>
</form>
</body>
</html>
謝謝VENU今天我就檢查了這一點,我喜歡消息部分將實現肯定 – user2033464