Guest User

Untitled

a guest
Mar 5th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. if(!empty($_POST['username']) && !empty($_POST['password']))
  2. {
  3. $query = "SELECT * FROM users WHERE username='".$_POST['username']."' AND binary password='".$_POST['password']."'";
  4.  
  5. $dbh = new PDO('mysql:host=localhost;dbname=example', 'user', 'password');
  6. $sth = $dbh->prepare('SELECT * FROM users WHERE username=? AND binary password=?');
  7. $sth->execute(array($_POST['username'], $_POST['password']));
  8. $result = $sth->fetch_all();
Add Comment
Please, Sign In to add comment