Guest User

Untitled

a guest
Aug 4th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.91 KB | None | 0 0
  1. <?php
  2. include 'include/connect.php';
  3. session_start();
  4. error_reporting('0');
  5.  
  6. if(isset($_SESSION['admin'])) // Checking whether the session is already there or not if
  7. // true then header redirect it to the home page directly
  8. {
  9. header("Location:index.php");
  10. }
  11.  
  12. if(isset($_POST['submit'])){
  13. $uname1=$_POST['n1'];
  14. $upass1=$_POST['p1'];
  15.  
  16. $sql= mysqli_query($connection,"SELECT * from admin where username='$uname1' and password='$upass1'");
  17.  
  18. $row=mysqli_num_rows($sql);
  19.  
  20.  
  21. if($row=='1')
  22.  
  23. {
  24. $_SESSION['admin']=$_POST['n1'];
  25. header("Location: index.php");
  26. }
  27. else
  28. {
  29.  
  30. $msg = "Wrong Username or Password Please Try Again!!";
  31. }
  32. }
  33. ?>
  34.  
  35. <html>
  36. <head>
  37. <title>Login | Admin</title>
  38. </head>
  39. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  40. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  41. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  42.  
  43. <style>
  44.  
  45.  
  46. body {
  47. background-color: #444;
  48. background: url("images/slika-2.jpg");
  49. background-size:cover;
  50.  
  51. }
  52. .form-signin input[type="text"] {
  53. margin-bottom: 5px;
  54. border-bottom-left-radius: 0;
  55. border-bottom-right-radius: 0;
  56. }
  57. .form-signin input[type="password"] {
  58. margin-bottom: 10px;
  59. border-top-left-radius: 0;
  60. border-top-right-radius: 0;
  61. }
  62. .form-signin .form-control {
  63. position: relative;
  64. font-size: 16px;
  65. font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  66. height: auto;
  67. padding: 10px;
  68. -webkit-box-sizing: border-box;
  69. -moz-box-sizing: border-box;
  70. box-sizing: border-box;
  71. }
  72. .vertical-offset-100 {
  73. padding-top: 100px;
  74. }
  75. .img-responsive {
  76. display: block;
  77. max-width: 100%;
  78. height: auto;
  79. margin: auto;
  80. }
  81. .panel {
  82. margin-bottom: 20px;
  83. background-color: rgba(255, 255, 255, 0.75);
  84. border: 1px solid transparent;
  85. border-radius: 4px;
  86. -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
  87. box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
  88. }
  89. </style>
  90. <script>
  91. $(document).ready(function() {
  92. $(document).mousemove(function(event) {
  93. TweenLite.to($("body"),
  94. .5, {
  95. css: {
  96. backgroundPosition: "" + parseInt(event.pageX / 8) + "px " + parseInt(event.pageY / '12') + "px, " + parseInt(event.pageX / '15') + "px " + parseInt(event.pageY / '15') + "px, " + parseInt(event.pageX / '30') + "px " + parseInt(event.pageY / '30') + "px",
  97. "background-position": parseInt(event.pageX / 8) + "px " + parseInt(event.pageY / 12) + "px, " + parseInt(event.pageX / 15) + "px " + parseInt(event.pageY / 15) + "px, " + parseInt(event.pageX / 30) + "px " + parseInt(event.pageY / 30) + "px"
  98. }
  99. })
  100. })
  101. })
  102. </script>
  103.  
  104. <script src="http://mymaplist.com/js/vendor/TweenLite.min.js"></script>
  105. <body>
  106. <div class="container">
  107. <div class="row vertical-offset-100">
  108. <div class="col-md-4 col-md-offset-4">
  109. <div class="panel panel-default">
  110. <div class="panel-heading">
  111. <div class="row-fluid user-row">
  112. <a href="../index.php"><img src="images/Finnacle club.png" class="img-responsive" alt="Admin"/ style="width:180px"></a>
  113. </div>
  114. </div>
  115. <div class="panel-body">
  116. <form method="POST" role="form" class="form-signin">
  117. <fieldset>
  118. <label class="panel-login">
  119. <div class="login_result"></div>
  120. </label>
  121. <?php
  122. echo $msg;
  123. ?>
  124. <input class="form-control" placeholder="Username" name="n1" maxlength="10" type="text">
  125. <input class="form-control" placeholder="Password" name="p1" type="password">
  126.  
  127. <a href="forget_password.php" style="color:black">Forgot Password ?</a>
  128.  
  129. <br></br>
  130. <input class="btn btn-lg btn-success btn-block" name="submit" type="submit" id="login" value="LOGIN">
  131. </fieldset>
  132. </form>
  133.  
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </body>
  140. </html>
Add Comment
Please, Sign In to add comment