• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: How do I create a registration form?

Re:How do I create a registration form? 14 years 3 months ago #12341

( 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!B)
The administrator has disabled public write access.

Re:How do I create a registration form? 14 years 3 months ago #12431

  • ahmad789
  • ahmad789's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
hello
I thank you for this interesting and good script
;)
The administrator has disabled public write access.

Re:How do I create a registration form? 13 years 2 months ago #16531

  • royce
  • royce's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 52
  • Thank you received: 5
Just hope your users don't enter something like:

username = '; DELETE * from `jos_users`

(SQL Injection!) B)
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!