Guest User

Untitled

a guest
Mar 17th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2. require_once('connection.php');
  3.  
  4. session_start();
  5. if(isset($_POST['username']) && isset($_POST['password'])){
  6. $username = $_POST['username'];
  7. $password = $_POST['password'];
  8. $query = $con->prepare("SELECT username, password FROM member WHERE username = '".$username."' && password = '".$password."'");
  9. $query->execute();
  10. while ($row = $query->fetch(PDO::FETCH_ASSOC)){
  11. if($username != $row['username']){
  12. echo "Username is not exist";
  13. }
  14. if($password != $row['password']){
  15. echo "Password is not valid";
  16. }
  17. if($password == $row['username'] && $username == $row['password']){
  18. $_SESSION['username'] = $username;
  19. $_SESSION['password'] = $password;
  20. header('location: index.php');
  21. }
  22. }
  23. }
  24. ?>
Add Comment
Please, Sign In to add comment