Strip off specific parameter from URL’s querystring

The safest “correct” method would be: Parse the url into an array with parse_url() Extract the query portion, decompose that into an array using parse_str() Delete the query parameters you want by unset() them from the array Rebuild the original url using http_build_query() Quick and dirty is to use a string search/replace and/or regex to … Read more

Joomla 3.2.1 password encryption

Try this, The following piece of code is creating Joomla standard password (Older Version 1.5,1.7 etc). jimport(‘joomla.user.helper’); $salt = JUserHelper::genRandomPassword(32); $crypt = JUserHelper::getCryptedPassword($password_choose, $salt); $password = $crypt.’:’.$salt; Joomla 3.2+ introduced PHP’s password algorithm bcrypt but it required a minimum PHP 5.3+ If you plan to use bcrypt make sure your server PHP version is capable … Read more

joomla password encryption

Joomla passwords are MD5 hashed, but the passwords are salted before being hashed. They are stored in the database as {hash}:{salt} this salt is a random string 32 characters in length. So to create a new password hash you would do md5($password.$salt) EDIT Okay so for checking a password, say a user myguy enters the … Read more

Strip off URL parameter with PHP

The safest “correct” method would be: Parse the url into an array with parse_url() Extract the query portion, decompose that into an array using parse_str() Delete the query parameters you want by unset() them from the array Rebuild the original url using http_build_query() Quick and dirty is to use a string search/replace and/or regex to … Read more

Importing jQuery into Joomla

This is the code we use to ensure only 1 copy of jQuery is imported. It simply checks to see if jQuery is already being imported and if not, then we import it 🙂 Joomla 2.5 <?php $app = JFactory::getApplication(); if (!$app->get(‘jquery’)) { $app->set(‘jquery’, true); JFactory::getDocument()->addScript(JUri::root() . ‘templates/template_name/js/jquery.js’); } ?> Joomla 3.x (no conflict mode): … Read more