Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define( '_JEXEC', 1 );
- define('JPATH_BASE', dirname(__FILE__) );
- define( 'DS', DIRECTORY_SEPARATOR );
- /* Required Files */
- require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
- require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
- $app = JFactory::getApplication('site');
- $app->initialise();
- require_once(JPATH_BASE.DS.'components'.DS.'com_users'.DS.'models'.DS.'registration.php');
- //not necessary
- //require_once(JPATH_BASE.DS.'libraries'.DS.'joomla'.DS.'application'.DS.'component'.DS.'helper.php';
- $model = new UsersModelRegistration();
- jimport('joomla.mail.helper');
- jimport('joomla.user.helper');
- $language = JFactory::getLanguage();
- $language->load('com_users', JPATH_SITE);
- $username = 'adam';
- $name = 'adam24';
- $email = 'adam@mailinator.com';
- $password = 'adam';
- $data = array( 'username' => $username,
- 'name' => $name,
- 'email1' => $email,
- 'password1' => $password, // First password field
- 'password2' => $password, // Confirm password field
- 'block' => 0 );
- echo $model->register($data);
- if (version_compare(PHP_VERSION, '5.3.1', '<')) {
- die('Your host needs to use PHP 5.3.1 or higher to run this version of Joomla!');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement