Advertisement
Guest User

Untitled

a guest
May 25th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2.      $username = $_POST['username']; //this is the username passed
  3.    $password = $_POST['password']; //this is the password passed
  4.  
  5.    $checkQuery = "SELECT username, password FROM users WHERE username='$username' password='$password'";
  6.  
  7.  
  8.    $checkQueryResult = mysql_query($checkQuery) or die(mysql_error());
  9.    
  10.    if ( mysql_num_rows($checkQueryResult >= 1) )
  11.    {
  12.       $_SESSION['username'] = $username;
  13.    }
  14.    else
  15.    {
  16.       echo "Login Credentials do not match."
  17.    }
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement