If you're
looking for a way to to protect your HTML page, this HTML code encrypter
may be your answer. HTML Password Protector will enable you to protect a
complete HTML page or just a portion of it.
This script will encode HTML using a password you select and will add a password
box. If your visitor types in an incorrect password, the HTML will not be
decoded.
Please note: This script will not work properly if your HTML code includes
JavaScript that pulls content from a file on your server. In addition, it
cannot encode short text. The longer the password the better the encoding
will be.
<script language="JavaScript1.2">
<!--linebreak
function get_password() {
orig_pass = prompt("Please enter password","");
if (orig_pass!=null && orig_pass!="")
password = new Array(orig_pass.length);
for(i=0; i<orig_pass.length; i++) {
password[i] = orig_pass.charCodeAt(i);
}
return password;
}
password = get_password();
orig = unescape("thecode");
orig = orig.split("");
passnum = orig.length % password.length;
for(i=orig.length-1; i>=0; i--) {
passnum--;
if (passnum == -1) passnum = password.length - 1;
pos1 = i;
pos2 = i + password[passnum];
if (pos2 >= orig.length) continue;
char1 = orig[pos1];
char2 = orig[pos2];
orig[pos2] = char1;
orig[pos1] = char2;
}
orig1 = "";
for(i=0;i<orig.length;i++) {
orig1 = orig1 + orig[i];
}
orig1 = orig1.replace(/mmm/g,"\r\n");
document.write(orig1);
//-->linebreak
</script>
<noscript>JavaScript must be enabled in your browse in order to see protected page.</noscript>
Script code provided by:
Zubrag |
|