Things You'll Need:
- HTML editor FTP program
-
Step 1
Open your HTML editor and create a new HTML document.
-
Step 2
Add the following javascript after the first header tag (<head>) but before the closing of the header (</head>).
<script language="javascript">
<!-- function pasuser(form) { if (form.id.value=="UserName") { if (form.pass.value=="YourPassword") { location="http://yourprotectedwebpage.com/" } else { alert("Wrong Password") } } else { alert("Wrong Username") } } -->
</script>
<form name="login">
Username: <input name="id" size="10" type="text">Password: <input name="pass" size="20" type="password"><input value="Submit" onclick="pasuser(this.form)" type="button">
</form> -
Step 3
In the javascript, replace "UserName" with your desired log-in name. Replace "YourPassword" with your secret password and enter the URL address of the webpage you want to protect in "yourprotectedwebpage.com."
-
Step 4
Save your HTML page. Open your FTP program and upload your HTML page to your server. Make sure that visitors to your site are directed to this log-in page. This ensures that they have to pass through this portal before viewing your protected webpage.











