Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. include('config.php');
  5.  
  6. /* Below two commands will store the data in variables came from form input */
  7. $_SESSION['username'] = $_POST['username'];
  8. $_SESSION['password'] = $_POST['password'];
  9.  
  10.  
  11. $username = $_SESSION['username'];
  12. $password = $_SESSION['password'];
  13. $query=mysql_query("SELECT * FROM users where username='$username' AND password='$password' ");
  14.  
  15.  
  16.  
  17. $count=mysql_num_rows($query);
  18. if($count==1)
  19. {
  20. $_SESSION["valid_user"] = $_POST["username"];
  21.  
  22. Header("location: members.php");
  23. }
  24. else
  25. {
  26. echo "Username or password is incorrect";
  27. echo "<br />";
  28. echo "<a href='login.php'>Try again</a>";
  29. }
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement