/ Published in: PHP

Makes a password protection system for single webpages.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<html> <head> <title>Private Page</title> </head> <body> <?php $password = "phpmac"; ?> <form action="" method="POST"> Enter the Password: <input type="password" name="password"><br> <input type="submit" name="submit"> </form> <?php } else { if ($_POST['password'] == $password) { ?> Secret content! <?php } else { ?> <form action="" method="POST"> Enter the Password: <input type="password" name="password"><br> <input type="submit" name="submit"> </form> <?php } } ?> </body> </html>
URL: http://www.phpmac.com/articles.php?view=242
Comments
