( placed on the "Scripts called on form process" area,Tab=Scripts ):
********************************************************************************************
if (isset($_POST['form']['username']))
{
$database =& JFactory::getDBO();
$fullname = $_POST['form']['fullname'];
$email = $_POST['form']['email'];
$username = $_POST['form']['username'];
$password = $_POST['form']['password'];
$database->setQuery("SELECT `id` FROM #__users WHERE `username`='".$username."'");
$database->query();
if ($database->getNumRows() > 0) die('This username is already taken. Please press back and try a different username.');
$database->setQuery("INSERT INTO #__users (`name`, `username`, `email`, `password`, `usertype`, `block`, `sendEmail`, `gid`, `registerDate`, `lastvisitDate`, `activation`, `params`) VALUES('".$fullname."', '".$username."', '".$email."', '".md5($password)."', '', 0, 0, 18, now(), now(), '', '')");
$database->query();
$userid = $database->insertid();
$database->setQuery("INSERT INTO #__core_acl_aro (`id`, `section_value`, `value`, `order_value`, `name`, `hidden`) VALUES ('', 'users', '".$userid."', 0, '".$fullname."', 0)");
$database->query();
$aro_id = $database->insertid();
$database->setQuery("INSERT INTO #__core_acl_groups_aro_map (`group_id`,`section_value`,`aro_id`) VALUES ('18','','".$aro_id."')");
$database->query();
}
add other fields if you wish, but do not forget the main fields, as they are entered in the Joomla DB. Excuse my English (google translator) I'm brazilian.
enjoy!