Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Simplest thing is to call the Wordpress function wp_hash_password(password). In which case your query would look like:</p> <pre><code>require_once '/path/to/wp-config.php'; //will load up wordpress, such as if you're doing this from a script $SQL = "SELECT * FROM wp_users where user_login='".$username."' and user_pass='".wp_hash_password($password)."'"; </code></pre> <p>Wordpress doesn't use standard MD5, but rather the <a href="http://www.openwall.com/phpass/" rel="nofollow">phpass</a> library, to hash user passwords. So, if you're trying to do this from outside of Wordpress, you then you will need to look into that library. Here's the code that implements the wp_hash_password() method using phpass:</p> <pre><code>if ( !function_exists('wp_hash_password') ) : /** * Create a hash (encrypt) of a plain text password. * * For integration with other applications, this function can be overwritten to * instead use the other package password checking algorithm. * * @since 2.5 * @global object $wp_hasher PHPass object * @uses PasswordHash::HashPassword * * @param string $password Plain text user password to hash * @return string The hash string of the password */ function wp_hash_password($password) { global $wp_hasher; if ( empty($wp_hasher) ) { require_once( ABSPATH . 'wp-includes/class-phpass.php'); // By default, use the portable hash from phpass $wp_hasher = new PasswordHash(8, TRUE); } return $wp_hasher-&gt;HashPassword($password); } endif; </code></pre> <p>You could presumably get the same content by following the same pattern:</p> <pre><code>require_once '/path/to/wp-includes/class-phpass.php'; $my_hasher = new PasswordHash(8, TRUE); $SQL = "SELECT * FROM wp_users where user_login='".$username."' and user_pass='". $my_hasher-&gt;HashPassword($password)."'"; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload