Advertisement
Guest User

Untitled

a guest
May 30th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include ('config.php');
  4.  
  5. $username = $_POST['username'];
  6. $password = $_POST['password'];
  7.  
  8. $username = stripslashes($username);
  9. $password = stripslashes($password);
  10. $username = mysql_real_escape_string($username);
  11. $password = mysql_real_escape_string($password);
  12.  
  13. $sql = "SELECT * FROM user WHERE username='$username' and password='$password'";
  14. $result = mysql_query($sql);
  15.  
  16. $count = mysql_num_rows($result);
  17.  
  18.     if($count ==1) {
  19.         $_SESSION['username'] = "$username";
  20.         $_SESSION['inloggad'] = "1";
  21.         header("location:members.php");
  22.  
  23.     }
  24.     else {
  25.         header("location:index.php");
  26.     }
  27. ob_end_flush();
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement