Hi everyone,
I’m a fresh web designer and I’m trying to put up my portfolio web site, but there is a section on the site that I don’t want people to access without a password. I found this free script but it seems to show the password right in the script when you view the source. It there any way to hide the password? Any help would be appreciated. Thanks!
<SCRIPT LANGUAGE=”JavaScript”>
function LogIn(){
loggedin=false;
username=””;
password=””;
username=prompt(“Username:”,””);
username=username.toLowerCase();
password=prompt(“Password:”,””);
password=password.toLowerCase();
if (username==”guest” && password==”login”) {
loggedin=true;
window.location=”home-page.html”;
}
if (username==”guest2″ && password==”login2″) {
loggedin=true;
window.location=”secure.html”;
}
if (loggedin==false) {
alert(“Invalid login!”);
}
}
</SCRIPT>