我一直在研究了這麼久,我已經這樣做了數百次,但我現在忘了。最簡單的事情。如何在PHP中進行密碼保護。請幫忙,當我點擊提交時,沒有東西彈出。這裏是我的代碼:PHP密碼保護
<html>
<style type="text/css">
#textbox1 {
text-shadow:2px 2px 3px #000000;
}
label {
text-shadow:2px 2px 3px #000000;
font-family:"Arial";
}
</style>
</style>
<script type="text/javascript">
function clearText(target){target.value= "";}
</script>
<head>
<center>
<form action="" method="POST">
<label face="Arial">Password: </label><input id="textbox1" type="password" name="password" value="" onfocus="clearText(this)">
<input id="button" type="submit" value="Login to Uploader">
</form>
</center>
</html>
<?php
$pass = $_POST['password'];
$submit = $_POST['submit'];
if (isset($_POST['submit'])) {
if ($pass == "pengsuploader123" || $pass="pass") {
echo "Test";
} else {
echo "Wrong!";
}
}
?>
你不必使用'名稱= submit'什麼,這就是爲什麼'isset($ _ POST [「提交」])=== FALSE'總是 – madfriend 2012-07-21 19:13:53
你的HTML標記灼傷我的眼睛。 – 2012-07-21 19:18:06