What is the best way to password protect folder/page using php without a db or username
Edit: SHA1 is no longer considered secure. Stored password hashes should also be salted. There are now much better solutions to this problem. You could use something like this: //access.php <?php //put sha1() encrypted password here – example is ‘hello’ $password = ‘aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d’; session_start(); if (!isset($_SESSION[‘loggedIn’])) { $_SESSION[‘loggedIn’] = false; } if (isset($_POST[‘password’])) { if … Read more