0
Welcome Guest! Login
0 items Join Now

ROCKETTHEME IS CLOSING ON JUNE 30, 2025. As a thank-you to our community, enjoy 50% off all themes with the promo code THANKYOU before we shut down. Read our Farewell Blog Post for more details.

registration

    • Rufty's Avatar
    • Rufty
    • Hero Rocketeer
    • Posts: 275
    • Thanks: 0

    registration

    Posted 13 years 8 months ago
    • would it be possible for me to create a large number of profiles using just one email address or could I change it that for now no email address would be required when registering?

      Is this possible in Joomla? thank you kindly.
    • Rufty's Avatar
    • Rufty
    • Hero Rocketeer
    • Posts: 275
    • Thanks: 0

    Re: registration

    Posted 13 years 8 months ago
    • Still trying to do this :(
    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Re: registration

    Posted 13 years 8 months ago
    • Create a html file with a form that includes these text input fields

      Username
      Password
      Name
      Email
      Usertype

      Point the form to register.php

      create a register.php and add this PHP, REMEMBER TO ADD YOUR DATABASE USERNAME AND PASSWORD AND JOOMLA DB NAME!!
      <?php
      // Select your MySQL host, username and password
      $con = mysql_connect('localhost','DB_USERNAME','DB_PASSWORD');
      if (!$con)
      {
           echo "Failed to make connection.";
           exit;
      }
      // Select the database. Enter the name of your database 
      $db = mysql_select_db('MY_JOOMLA_DATABASE');
      if (!$db)
      {
           echo "Failed to select db.";
           exit;
      }
       
      $username   = $_POST['username'];
      $password   = $_POST['password'];
      $names       = $_POST['names'];
      $email       = $_POST['email'];
      $usertype   = $_POST['usertype'];
       
      $sql          = "SELECT username FROM jos_users WHERE username = '" . $username . "'";
      $query       = mysql_query($sql);
      if (mysql_num_rows($query) > 0)
      {
           echo "That username already exists";
      }
      else
      {
           $insert = "INSERT INTO jos_users (id,name,username,email,password,usertype,block,sendEmail,gid,registerDate,lastvisitDate,activation,params) VALUES ('','" . $names . "','" . $username . "','" . $email . "','" . $password . "','" . $usertype . "','0','0','31','','','','')";
           $query  = mysql_query($insert);
           
           $sql2 = "SELECT id FROM jos_users ORDER BY id DESC LIMIT 1";
           $query2 = mysql_query($sql2);
           $rownew = mysql_fetch_array($query2);
           $id = $rownew['id'];
           $newid = $id++;
           
           $insert2 = "INSERT INTO jos_core_acl_aro (id,section_value,value,order_value,name,hidden) VALUES ('','users','" . $newid . "','0','" . $names . "','0')";
           $query3 = mysql_query($insert2);
           $sql3 = "SELECT id FROM jos_core_acl_aro WHERE value = '" . $newid . "'";
           $query4 = mysql_query($sql3);
           $row2 = mysql_fetch_array($query4);
           $id2 = $row2['id'];
           $insert3 = "INSERT INTO jos_core_acl_groups_aro_map (group_id,section_value,aro_id) VALUES ('31','','" . $id2 . "')";
           $query5 = mysql_query($insert3);
           if ($query || $query2 || $query3)
           {
                echo "Thanks for registering. You may now login. $id. $newid";
           }
           else
           {
                echo "Creating account failed";
           }
      }
      ?>

      That should allow you to create users outside of joomla and without any checks (apart from checking the username is unique) this can be used and adapted in any way.
      It also creates the relevant info for the user group (jos_core_acl_aro AND jos_core_acl_groups_aro_map)

      This code is given FREE and is something i wrote myself, it is to be used at your own risk, if in doubt... backup before you use it!!

      Ad,
    • Kiss my RSS
    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Re: registration

    Posted 13 years 8 months ago
    • Oh and delete the form and PHP file after you have used it, it would be vey dangerous to leave it on the server!!
    • Kiss my RSS

Time to create page: 0.064 seconds