Hi. I have this script, where I want it to use a multi-user login. the code is below.
[I]var username=window.prompt(‘Enter your Username’);
var password=window.prompt(‘Enter your Password’);
if (username=”Nick” && password=”a”){var login=”1″;} Else {var login=”0″;}
if (username=”Bob” && password=”b”){var login=”2″;} Else {var login=”0″;}
if (username=”Joe” && password=”c”){var login=”3″;} Else {var login=”0″;}
switch (login){
case “1”:
window.alert(‘Welcome, Nick’);
window.location(‘
case “2”:
window.alert(‘Welcome, Bob’);
window.location(‘
case “3”:
window.alert(‘Welcome, Joe’);
window.location(‘
case “4”:
window.alert(‘Who are you?!? Begone with you!’);
window.location(‘
}
I have 2 problems. One is that mainly, it doesn’t work! If someone could help me out, I’d appreciate it. And Two, is there someway you can block an external script from being viewed in a browser, or someway to keep people from reading the Usernames and Passwords? Thanks.