Advertisement
Guest User

Untitled

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