简体   繁体   中英

Unable to implement custom log in in wordpress

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.

wp_hash_password函数需要两个参数

wp_set_password( $password, $user_id );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM