dimanche 5 avril 2015

How to use WordPress DB to access to another page [on hold]

I have one WordPress page, where I have some users. I have another page which is not wordpress. And I want to have the same login and password on this page. So I need to use the same hash function like wordpress is using. Do you know how to do it? How I can login with the same login?


pass in db:



$P$B6KbvAS/XcWQukKD/PLiwhh7lrjfor/



When I used http://ift.tt/jLcHRH



// Base-2 logarithm of the iteration count used for password stretching
$hash_cost_log2 = 8;
// Do we require the hashes to be portable to older systems (less secure)?
$hash_portable = TRUE;

$hasher = new PasswordHash($hash_cost_log2, $hash_portable);
$hash = $hasher->HashPassword($pass);

echo 'HASH: ' . $hash;


result was:



$P$B8oa7QB58yfEGvrYyUeERmFnuKPBjV.





I tested this source: http://ift.tt/1a3gFvE



if(wp_check_password($pass, '$P$BJdhfMS1wb7vE3A3/BR0SkA5V26Az80', $user_id = '171'))echo 'OK'; else echo 'BAD';


But it is still always BAD.


Thank you very much.


Aucun commentaire:

Enregistrer un commentaire