if you want to restrict unwanted users to access your page in this tutorial we will show you how to protect PHP pages using short lines of php code
<?php $password = "pass"; // If password matchs let the user get access if (isset($_POST["password"]) && ($_POST["password"]=="$password")) { ?> <html> <body> PLACE YOUR CONTENT HERE <?php } else { //Display message if wrong password or no password entered. if (isset($_POST['password']) || $password == "") { echo "<p align=\"center\"><font color=\"red\"><b>Incorrect Password</b><br>Please enter the correct password</font></p>";} echo "<form method=\"post\"><p align=\"center\">Please enter password : <br>"; echo "<input name=\"password\" type=\"password\" size=\"25\"><input value=\"Login\" type=\"submit\"></p></form>"; } ?> </body> </html>
hello there, superior website, and a really good understand! at least one for my favorites.