Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript

function LogIn(){
loggedin=false;
username="";
password="";
username=prompt("UserName:","");
//username=username.toLowerCase();
password=prompt("PassWord:","");
//password=password.toLowerCase();

if (username=="User-1" && password=="PassWord-1") { 
loggedin=true;
window.location="https://site-1.com";
}

if (username=="User-2" && password=="PassWord-2") {
loggedin=true;
window.location="https://site-2.com";
}

//if (loggedin==false) {
if (loggedin===false) {
alert("OOPS!");
}
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
6+6 =