0

I want to implement custom login for wordpress users. But unable to match passwords when login. Dont know what encryption I need to use for password. Am using wp_hash_password() to encrypt password but it is not working for me. I am using like this:

  $username =$_POST['username'];
  $hash = wp_hash_password( $_POST['password']) ;
  $results = $wpdb->get_results("SELECT * FROM wp_users WHERE `user_login` =  '".$username."' AND `user_pass` = '".$hash."'");

Thanks in advance.

4

1 回答 1

0

wp_hash_password 函数需要两个参数

wp_set_password( $password, $user_id );
于 2014-10-08T12:36:44.993 回答