Guest User

Untitled

a guest
Aug 16th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <title>Javascript - Forms</title>
  4. <script type="text/javascript">
  5. function test() {
  6. var userName = document.forms[0].elements[0].value;
  7. var password = document.forms[0].elements[1].value;
  8. var x = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
  9. var y = new Date();
  10. var h = y.getHours();
  11. var brake_it = h + 10;
  12. var crack_it = h - 21
  13. x.reverse();
  14. for (i=0;i<=5;i++) {
  15. x.pop(x[i]);
  16. x.push(h);
  17. }
  18. var combination = x[0] + brake_it;
  19. var combination1 = x[0] + crack_it;
  20. if ((userName==combination) && (password==combination1)) {
  21. alert("You are right, thats the combination :)");
  22. }
  23. }
  24. </script>
  25. </head>
  26. <body>
  27. <form>
  28. Username:<input type="text" />
  29. Password:<input type="text" />
  30. <input type="button" value="Click me" onClick="test();" />
  31. </form>
  32. </body>
  33. </html>
Add Comment
Please, Sign In to add comment