Created
May 30, 2010 17:00
-
-
Save jffkka/419163 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Define your username and password | |
$username = "USERNAME HERE"; | |
$password = "PASSWORD HERE"; | |
if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) { | |
?> | |
<h1>Login</h1> | |
You must login to see this private content.<br> | |
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> | |
<p><label for="txtUsername">Username:</label> | |
<br /><input type="text" title="Enter your username" name="txtUsername" /></p> | |
<p><label for="txtpassword">Password:</label> | |
<br /><input type="password" title="Enter your password" name="txtPassword" /></p> | |
<p><input type="submit" name="Submit" value="Login" /></p> | |
</form> | |
<?php | |
} | |
else { | |
?> | |
<p><h1>Hello!</h1> | |
<br>If you are seeing this, you have logged in successfully.</p> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment