Guest User

Untitled

a guest
Mar 7th, 2016
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.02 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html lang="en">
  4.  
  5. <head>
  6.  
  7. <meta charset="utf-8">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9. <meta name="viewport" content="width=device-width, initial-scale=1">
  10. <meta name="description" content="">
  11. <meta name="author" content="">
  12.  
  13. <title>Grayscale - Start Bootstrap Theme</title>
  14.  
  15. <!-- Bootstrap Core CSS -->
  16. <link href="css/bootstrap.min.css" rel="stylesheet">
  17.  
  18. <!-- Custom CSS -->
  19. <link href="css/login.css" rel="stylesheet">
  20.  
  21. <!-- Custom Fonts -->
  22. <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  23. <link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
  24. <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
  25.  
  26. <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  27. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  28. <!--[if lt IE 9]>
  29. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  30. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  31.  
  32. <![endif]-->
  33.  
  34.  
  35. </head>
  36. <div class="container">
  37. <div class="row">
  38. <div class="col-md-6 col-md-offset-3">
  39. <div class="panel panel-login">
  40. <div class="panel-heading">
  41. <div class="row">
  42. <div class="col-xs-6">
  43. <a href="#" class="active" id="login-form-link">Login</a>
  44. </div>
  45. <div class="col-xs-6">
  46. <a href="#" id="register-form-link">Register</a>
  47. </div>
  48. </div>
  49. <hr>
  50. </div>
  51. <div class="panel-body">
  52. <div class="row">
  53. <div class="col-lg-12">
  54. <form id="login-form" action="" method="post" role="form" style="display: block;" >
  55. <div id="error"></div>
  56. <div class="form-group">
  57. <input type="text" name="username" id="username" tabindex="1" class="form-control" placeholder="Username" value="" required/>
  58. </div>
  59. <div class="form-group">
  60. <input type="password" name="password1" id="password" tabindex="2" class="form-control" placeholder="Password" required />
  61. </div>
  62.  
  63. <div class="form-group">
  64. <div class="row">
  65. <div class="col-sm-6 col-sm-offset-3">
  66. <input type="submit" name="login-submit" id="login-submit" tabindex="4" class="form-control btn btn-login" value="Log In">
  67. </div>
  68. </div>
  69. </div>
  70. <div class="form-group">
  71. <div class="row">
  72. <div class="col-lg-12">
  73.  
  74. </div>
  75. </div>
  76. </div>
  77. </form>
  78. <form id="register-form" action="" method="post" role="form" style="display: none;">
  79. <div class="form-group">
  80. <input type="text" name="username" id="username1" tabindex="1" class="form-control" placeholder="Username" value=""/>
  81. </div>
  82. <div id="status"></div>
  83. <div class="form-group">
  84. <input type="email" name="email" id="email" tabindex="1" class="form-control" placeholder="Email Address" value="" required/>
  85. </div>
  86. <div class="form-group">
  87. <input type="password" name="password" id="password" tabindex="2" class="form-control" placeholder="Password"/>
  88. </div>
  89. <div class="form-group">
  90. <input type="password" name="confirm-password" id="confirm-password" tabindex="2" class="form-control" placeholder="Confirm Password"/>
  91. </div>
  92. <div class="form-group">
  93. <div class="row">
  94. <div class="col-sm-6 col-sm-offset-3">
  95. <input type="submit" name="register-submit" id="register-submit" tabindex="4" class="form-control btn btn-register" value="Register Now"/>
  96. </div>
  97. </div>
  98. </div>
  99. </form>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <script src="js/jquery.js"></script>
  108. <script src="js/login.js"></script>
  109.  
  110.  
  111. <script type="text/javascript">
  112.  
  113. $(document).ready(function(){
  114. $("#error").css('display', 'none', 'important');
  115. $("#login-submit").click(function(){
  116. var username=$("#username").val();
  117. var password=$("#password").val();
  118. $.ajax({
  119. type: "POST",
  120. url: "../blog/database/login.php",
  121. data: "name="+username+"&pwd="+password,
  122. success: function(html){
  123. if(html=='coordinator') {
  124. window.location = "../blog/addpost.php";
  125. }
  126. else if(html=='Normal') {
  127. window.location = "konnect.php";
  128. }
  129. else {
  130. $("#error").css('display', 'inline', 'important');
  131. $("#error").html("<p>Wrong username or password</p>");
  132. }
  133. },
  134. beforeSend:function()
  135. {
  136. $("#error").css('display', 'inline', 'important');
  137. $("#error").html("<img src='images/ajax-loader.gif' /> Loading...")
  138.  
  139. }
  140. });
  141. return false;
  142. });
  143. $("#username1").change(function()
  144. {
  145. var username = $("#username1").val();
  146. var msgbox = $("#status");
  147.  
  148. if(username.length > 3)
  149. {
  150. $("#status").html('Checking availability');
  151.  
  152. $.ajax({
  153. type: "POST",
  154. url: "../blog/database/registration.php",
  155. data: "username="+ username,
  156. success: function(data){
  157. $("#status").html(data);
  158. }
  159. });
  160.  
  161. }
  162. else
  163. {
  164.  
  165. $("#status").html('Enter valid User Name');
  166. }
  167. return false;
  168. });
  169. });
  170.  
  171.  
  172. //-->
  173. </script>
  174. <script src="http://jqueryvalidation.org/files/dist/jquery.validate.min.js"></script>
  175. <script src="http://jqueryvalidation.org/files/dist/additional-methods.min.js"></script>
  176. <script>
  177. // just for the demos, avoids form submit
  178. jQuery.validator.setDefaults({
  179. debug: true,
  180. success: "valid"
  181. });
  182. $( "#register-form" ).validate({
  183. rules: {
  184. password: "required",
  185. confirm-password: {
  186. equalTo: "#password"
  187. }
  188. },messages: {
  189. password :" Enter Password",
  190. confirmpassword :" Enter Confirm Password Same as Password"
  191. }
  192.  
  193. });
  194. </script>
  195. </body>
  196. </html>
Add Comment
Please, Sign In to add comment