Friday, April 13, 2018

Password Protects Web Page in JavaScript

A simple password protect web page script in JavaScript that I would like to share with you guys.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Program Listing

password.htm

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Input Correct Password</title>
<style type="text/css">
.style1 {
font-size: 30px;
color: #FF00FF;
font-family: "Times New Roman", Times, serif;
font-weight: bold;
}
</style>
<script language="JavaScript">
var password="";
password=prompt('Please input a password, then you can visit our web page:');
if (password != '123admin')
{alert("Wrong password! You cannot visit our web page!");
window.close( );} 
</script>
</head>
<body>
<div align="center">
  <p>&nbsp;</p>
  <p class="style1">Password correct! </p>
  <p class="style1">Welcome to our website!!!</p>
</div>
</body>
</html>

No comments:

Post a Comment