Last active
August 29, 2015 14:28
-
-
Save jayllellis/0e91bacd8a96bd2b8e7f to your computer and use it in GitHub Desktop.
Simple prompt user for password before allowing access to page.
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Password Prompt</title> | |
<script type="text/javascript"> | |
function checkpassword(){ | |
var VIPpassword; | |
VIPpassword = prompt("Please enter the password", ""); | |
if (VIPpassword != 'testpassword') { | |
alert("The password you entered is not correct. Please see the correct password on the page."); | |
window.location = "http://jasonellis.ca"; | |
} | |
} | |
</script> | |
</head> | |
<body onload="javascript:checkpassword();"> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment