Advertisement
Guest User

BroCialize Code for Stackoverflow

a guest
Jan 11th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title> BroCialize </title>
  5.  
  6. <script>
  7.  
  8. var count= 2;
  9.  
  10. function validate(){
  11.  
  12. var username = document.login.username.value;
  13. var password = document.login.password.value;
  14. var valid= false;
  15. var usernameArray = ["Gdp", "Hekman", "Koning", "ErikHekman", "ThijsWaardenburg", "Ronald", "RonaldVanEssen" ];
  16. var passwordArray = ["Gdp123", "Hekman123", "Koning123", "ErikHekman123", "ThijsWaardenburg123", "Ronald123", "RonaldVanEssen123"];
  17.  
  18. for (var i = 0; i < usernameArray.length; i++)
  19.  
  20. {
  21.  
  22. if ((username == usernameArray[i]) && (password == passwordArray[i]))
  23. {
  24. valid = true;
  25. break;
  26. }
  27. }
  28.  
  29. if (valid)
  30. {
  31. alert("Log in was succesfull!")
  32. window.location = "timeline";
  33. return false;
  34. }
  35. var again = "tries";
  36. if (count ==1)
  37. {
  38. again = "try"
  39. }
  40. if (count >= 1)
  41. {
  42. alert("Wrong password or username")
  43. count--;
  44. }
  45. else
  46. {
  47. alert("Too many attempts");
  48. document.login.username.value = "You are now blocked";
  49. document.login.pass.value = "You are now blocked";
  50. document.login.username.disabled = true;
  51. document.login.password.disabled = true;
  52. return false;
  53. }
  54. }
  55.  
  56.  
  57.  
  58. </script>
  59.  
  60. <style>
  61. html {font-family:Arial, Helvetica, sans-serif; color:#333;}
  62. body { background:#CCC; margin:0; }
  63. #container { width:900px; margin:0 auto; background:#FFF; }
  64. #header { width:100%; height:60px; border-bottom:1px solid #c7c7c7; background:#3f0b04; text-align:center; }
  65. #header h1 {color:#e7c321; }
  66.  
  67. #logo { float:left; width:40px; height:40px; margin:10px; background:#CCC;}
  68. #navbar { height:36px; clear:both; background-color:#e7c321; }
  69. #navbar ul { margin:0; padding:0; list-style-type:none; }
  70. #navbar ul li { padding:10px; float:left; }
  71. #navbar ul li a { font size:12px; float:left; padding:0 0 0 20px; display:block; }
  72. #banner { background:#3f0b04; heigth:120px; clear:both; padding:20px; text-align:center; color:#FFF; margin:10px 0 2px 0;}
  73. #middle-collum { float:left; width:858px; height:500px; border:1px solid #333; color:#000; background:#bcbab4; padding:20px; text-align:center; }
  74. #login-logo {width:100%; ; height:200px; float:center;}
  75. #login-form {float:center; width:175px; }
  76. #submit {width:170px; float:center;}
  77. #register {width:170px; float:center;}
  78.  
  79. #footer { padding:20px; clear:both; color:#FFF; background-color:#3f0b04; text-align:center; }
  80. </style>
  81.  
  82. </head>
  83.  
  84.  
  85. <body>
  86.  
  87. <!-- CONTAINER -->
  88. <div id="container">
  89. <!-- HEADER -->
  90. <div id="header">
  91. <div id="logo"><img src="http://imgur.com/578H3e8.png"></img></div>
  92. <h1>BroCialize</h1>
  93. <div id="navbar">
  94. <ul>
  95. <li><a href="url"></a></li>
  96. <li><a href="url"></a></li>
  97. <li><a href="url"></a></li>
  98. </ul>
  99. </div>
  100. </div>
  101. <!-- CONTENT AREA -->
  102. <div id="content-area">
  103. <div id="banner">This site is Legen...wait for it...Dary</div>
  104. <div id="middle-collum">
  105. <div id="login-logo"><img src="http://imgur.com/uelX4ie.png></img></div>
  106. <div id="login-form">
  107. <form method="POST">
  108. <input type="text" name="username" placeholder="username" />
  109. <br>
  110. <input type="password" name="password" placeholder="password" />
  111. <br>
  112. </form>
  113. <button id="submit">Log in</button>
  114. <br>
  115. <button id="register">Register</button>
  116. </div>
  117.  
  118. </div>
  119. </div>
  120. <!--FOOTER -->
  121. <div id="footer">Copyright by BroCialize - 2016</div>
  122. </div> <!-- END CONTAINER -->
  123. </body>
  124. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement