0% found this document useful (0 votes)
20 views1 page

Index

This PHP script protects a webpage with a password. It checks if the submitted password matches the predefined password, and if so, shows the protected content. If not, it displays a login form to enter the password again.

Uploaded by

Ankit MastIkhor
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Index

This PHP script protects a webpage with a password. It checks if the submitted password matches the predefined password, and if so, shows the protected content. If not, it displays a login form to enter the password again.

Uploaded by

Ankit MastIkhor
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

<?

php
/* PHP Simple PasswordProtect v1.0 */
$password = "admin"; // Modify Password to suit for access, Max 10 Char.
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Simple Password Protect - PHP PasswordProtect</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
P { FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Verdana, Tahoma, Arial}
TD { FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Verdana, Tahoma, Arial}
-->
</style>
</head>
<body>
<?php
print "<h2 align=\"center\">PHP Simple Password Protect</h2>";
// If password is valid let the user get access
if (isset($_POST["password"]) && ($_POST["password"]=="$password")) {
?>
<!-- START OF HIDDEN HTML - PLACE YOUR CONTENT HERE -->
<p align="center"><br><br><br>
<b>Congratulations</b><br>you have gained access to the Protected and Secret A
rea!</p>
<!-- END OF HIDDEN HTML -->
<?php
}
else
{
// Wrong password or no password entered display this message
if (isset($_POST['password']) || $password == "") {
print "<p align=\"center\"><font color=\"red\"><b>Incorrect Password</b><br>Pl
ease enter the correct password</font></p>";}
print "<form method=\"post\"><p align=\"center\">Please enter your password fo
r access<br>";
print "<input name=\"password\" type=\"password\" size=\"25\" maxlength=\"10\"
><input value=\"Login\" type=\"submit\"></p></form>";
}
print "<br><br><p align=\"center\">Written by <a href=\"http://www.stevedawson
.com\">SteveDawson.com</a></p>";
?>
<BR>
</body>
</html>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy