可以用php的session或者cookie實現首次開啟和關閉瀏覽器重新開啟都需要輸入密碼才可以訪問密碼是admin123456789101112131415<?phpsession_start();if(isset($_POST["password"]) && $_POST["password"] == "admin"){ $_SESSION["ok"] = 1; header("location:?");}if(!isset($_SESSION["ok"])){ exit(" <form method="post"> 密碼:<input type="password" name="password" /> <input type="submit" value="登陸" /> </form> ");}?>12345678<html><head><title>title</title></head><body>輸入密碼才能訪問這個頁面</body></html>
可以用php的session或者cookie實現首次開啟和關閉瀏覽器重新開啟都需要輸入密碼才可以訪問密碼是admin123456789101112131415<?phpsession_start();if(isset($_POST["password"]) && $_POST["password"] == "admin"){ $_SESSION["ok"] = 1; header("location:?");}if(!isset($_SESSION["ok"])){ exit(" <form method="post"> 密碼:<input type="password" name="password" /> <input type="submit" value="登陸" /> </form> ");}?>12345678<html><head><title>title</title></head><body>輸入密碼才能訪問這個頁面</body></html>