Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include 'debian.php';
  4.  
  5. $username = htmlspecialchars($_POST['username']);
  6. $password = htmlspecialchars($_POST['password']);
  7.  
  8. $uid = addslashes($username);
  9. $pwd = addslashes($password);
  10. $binary = pack('a',$pwd);
  11. $enc = encrypt($binary);
  12.  
  13.  
  14. $sql = "SELECT account, password FROM user_auth WHERE account='$uid'";
  15. $stmt = sqlsrv_query( $conn, $sql );
  16. if( $stmt === false) {
  17.     die( print_r( sqlsrv_errors(), true) );
  18. }
  19.  
  20. if( sqlsrv_fetch( $stmt ) === False) {
  21.      die( print_r( sqlsrv_errors(), false));
  22. }
  23.  
  24. $rows = sqlsrv_has_rows( $stmt );
  25.  
  26.    
  27.    if ($rows === true) {
  28.       echo "Found. <br />";
  29.       $pwdformat = (string) sqlsrv_get_field( $stmt, 1);
  30.       echo bin2hex($pwdformat);
  31.    }
  32.    else {
  33.       echo "None <br />";
  34. }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement