Advertisement
Guest User

Untitled

a guest
Aug 30th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <?php
  2. if (isset($_POST['submit'])){
  3. $username = $_POST['username'];
  4. $password = $_POST['password'];
  5.  
  6.  
  7. $result = mysqli_query($dbcon,"SELECT * FROM users WHERE username='$username' AND password='$password'")or die(mysqli_error());
  8. $num_row = mysqli_num_rows($result);
  9. $row=mysqli_fetch_array($result);
  10. if( $num_row > 0 ) {
  11. ?>
  12.  
  13.  
  14. <script>alert('Login Successful');
  15. window.location='attendance.php';</script>
  16. <?php
  17.  
  18. $_SESSION['id']=$row['user_id'];
  19.  
  20. }
  21.  
  22. else{ ?>
  23. <div class="alert alert-danger">Access Denied</div>
  24. <?php
  25. }}
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement