How To Create Password Protect Using JavaScript
Submitted by alpha_luna on Wednesday, April 6, 2016 - 14:13.
Good Day!!!
In this tutorial, we are going to learn on How To Create Password Protect Using JavaScript. In the codes below provide a broad password to protect a certain page. Hope you can learn from this tutorial.Password: nextpage
Directions:
First Step: Kindly save this image to your computer or you can change this whatever you want.
- <script language="javascript">
- var nifty_little_window = null;
- function passwordStopper() {
- nifty_little_window = window.open('home.html', 'theStopper',
- 'width=500,height=500,resizable=1');
- }
- </script>
Third Step: Copy this and kindly save it as a new page. Save it as home.html or you can change this name whatever you want.
- <!DOCTYPE html>
- <html>
- <head>
- <title>
- Password Stopper
- </title>
- <script language="JavaScript">
- function Tryit() {
- var location;
- var password;
- password=this.document.testingForm.testingTextBox.value
- location=password + ".html"
- fetch(location)
- theStopper=window.close()
- }
- function fetch(location) {
- var root;
- if (opener.closed) {
- root=window.open('','thePasswordStopper','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');
- root.location.href = location;
- } else {
- opener.location.href = location;
- }
- }
- </script>
- <style type="text/css">
- </style>
- </head>
- <body>
- <img src="image/11.gif" width="150" height="150" style="margin-left:170px;">
- <table border="1">
- <tr>
- </tr>
- <tr>
- <td>
- <form name="testingForm" style="margin:auto; text-align:center;">
- <br />
- <input type="text" name="testingTextBox" autofocus='autofocus' style="font-size:18px; border-radius:4px; text-indent:5px;">
- <br />
- <br />
- <img src="image/button.png" width="150" height="75" onClick="Tryit(this.form)" style="cursor:pointer;">
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>
Add new comment
- 233 views