unleashed
02-14-2008, 09:50 AM
Password protect a webpage on any host
As we know that many freehosts don`t allow password protecting pages
Lets password protect a page ourselves using a simple javascript smile.gif
Now we suppose my page`s html code is the following:-
<html>
<head>
<title>Testing Password</title>
</head>
<body>
<b>This was just a test</b>
</body>
</html>
Now we need to modify the code a bit to add the script.
Modify the above code like this:-
<html>
<head>
<title>Testing Password</title>
</head>
<body>
<script language="javascript">
var a = prompt("Enter the password to access this page")
if (a=="YourPasswordHere"){alert("Permission Granted");}
else{alert("Sorry, Wrong password.\n\nPlease try again.");location.reload();}
</script>
<b>This was just a test</b>
</body>
</html>
And just save it
DON`T FORGET TO CHANGE "YourPasswordHere" WITH YOUR PASSWORD
--------------------
As we know that many freehosts don`t allow password protecting pages
Lets password protect a page ourselves using a simple javascript smile.gif
Now we suppose my page`s html code is the following:-
<html>
<head>
<title>Testing Password</title>
</head>
<body>
<b>This was just a test</b>
</body>
</html>
Now we need to modify the code a bit to add the script.
Modify the above code like this:-
<html>
<head>
<title>Testing Password</title>
</head>
<body>
<script language="javascript">
var a = prompt("Enter the password to access this page")
if (a=="YourPasswordHere"){alert("Permission Granted");}
else{alert("Sorry, Wrong password.\n\nPlease try again.");location.reload();}
</script>
<b>This was just a test</b>
</body>
</html>
And just save it
DON`T FORGET TO CHANGE "YourPasswordHere" WITH YOUR PASSWORD
--------------------