Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ?>
  4. <?php
  5.  
  6.  
  7. include('connections.php');
  8. $user=$_POST['username'];
  9. $pass=$_POST['password'];
  10.  
  11.  
  12. if ($db_found) {
  13.  
  14.  
  15.  
  16. $sql="SELECT * FROM users WHERE username='$user' and password='$pass'";
  17. $result=mysql_query($sql);
  18.  
  19. $count=mysql_num_rows($result);
  20. if($count==1){
  21. header("location:index.php?user=$user");
  22. $_SESSION['user']=$_POST['username'];
  23. }
  24. else {
  25. echo "Wrong Username or Password";
  26. }
  27.  
  28. mysql_close($db_handle);
  29.  
  30. }
  31.  
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement