SoulieBaby SoulieBaby - 3 months ago 6x
PHP Question

using php to create a joomla user password?

I'm trying to create a custom registration component for Joomla, and I was wondering if anyone knew how to create the correct password encryption for joomla? Joomla passwords look like this :


Which I believe are md5 (or something) and one way encryption? Am just looking for a php code of sorts to create that same encryption.


$salt = JUserHelper::genRandomPassword(32);
$crypt = JUserHelper::getCryptedPassword("yourpassword", $salt);
$password = $crypt.':'.$salt;

After a bit more searching i found my answer, thanks guys for your help :)

EDIT: I forgot to mention that you need to include this line before calling JUserHelper: