Guest User

Untitled

a guest
Dec 16th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. include 'mysql.php';
  4.  
  5. $username = $_POST['username'];
  6. $password = $_POST['password'];
  7. $query = "SELECT * FROM `user` WHERE username='$username' and password='$password'";
  8. $result = mysqli_query($connection, $query) or die(mysqli_error($connection));
  9. $count = mysqli_num_rows($result);
  10.  
  11. if ($count == 1) {
  12. echo "You are logged in as " . $username;
  13. }
  14. else {
  15. header('Location: index.html');
  16. }
  17. ?>
  18. <br><br><a href="index.html">Logout</a>
Add Comment
Please, Sign In to add comment