Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script language="JavaScript">
  4.  
  5. var names = ["MACK","KAV"];
  6. var user = prompt("Please enter your username.").toUpperCase();
  7.  
  8. switch(user) {
  9. case names[0]:
  10. var password = prompt("Please enter your password.").toUpperCase();
  11. if(user === 'MACK' && password === 'ATTACK') {
  12. document.write("Hi Mack! Welcome back!");
  13. }
  14. else{
  15. for(i =0; i >1000; i++) {
  16. document.write("Password not valid!!! ");
  17. };
  18. };
  19. break;
  20. case names[1]:
  21. var password = prompt("Please enter your password.").toUpperCase();
  22. if(user === 'KAV' && password === 'KAV') {
  23. document.write("Hello!");
  24. }
  25. else{
  26. for(i =0; i >1000; i++) {
  27. document.write("Password not valid!!! ");
  28. };
  29. };
  30. break;
  31. default:
  32. for(i =0; i >1000; i++) {
  33. document.write("Username not valid!!! ");
  34. };
  35. };
  36.  
  37. </script>
  38. </head>
  39. <body>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement