Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

Adding user to phpbb3 during registration from site

Hello Friends,

If you are looking for adding user into phpbb3 forum when any user register into your site, than i might help you as i faced the same situation. Today i faced this situation where my client needs the same user in phpbb forum(auto entry) whenever user register into website. This is an external script using which you can make entry into users table of phpbb3 forum. Also if you want to transfer all your site users into phpbb3 forum than also this will works.
 

    define('IN_PHPBB', true);
   
    global $db;
    global $config;
    global $user;
    global $auth;
    global $cache;
    global $template;
    global $phpbb_root_path;
    global $phpEx;
   

    $phpbb_root_path = 'forums/';  // forum directory path here
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    //include($phpbb_root_path . 'common.' . $phpEx);
   
    include('forums/common.php');
   
    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
   
    require($phpbb_root_path .'includes/functions_user.php');
   
    $username = $_POST['user'];
    $password = $_POST['password']; // Dont encrypt the password!
    $email = $_POST['email'];
   
    // Check for unique username otherwise it will throw an error or might be blank page
   
    $user_row = array(
    'username' => $username,
    'user_password' => md5($password), 'user_email' => $email,
    'group_id' => 2, #Registered users group
    'user_timezone' => '1.00',
    'user_dst' => 0,
    'user_lang' => 'en',
    'user_type' => '0',
    'user_actkey' => '',
    'user_dateformat' => 'd M Y H:i',
    'user_style' => 1,
    'user_regdate' => time(),
    );
           
    $phpbb_user_id = user_add($user_row);

To know more about programming,JavaScript issues,jQuery,Expression Engine,MYSQL database and Open-source, enter your email address below. We will send you free tutorials.

Enter your email address:
 
Feel free to ask any question. Just leave your comment below and we will answer your comment with in 24 hours.
Share:

14 Comments

  • Rob

    Hi, this is exactly what I've been looking for for ages! When a user subscribes to mailchimp I want to create a user account for them on my phpBB3.
    Sorry this is so basic, but never used php before, so how do I apply the above code in practice? Fom action? hidden fields?
    Massively appreciate any help given. Feel free to ask for more details, but not sure what you may need.
    Rob

  • Rob

    Hi, this is exactly what I've been looking for for ages! When a user subscribes to mailchimp I want to create a user account for them on my phpBB3.
    Sorry this is so basic, but never used php before, so how do I apply the above code in practice? Fom action? hidden fields?
    Massively appreciate any help given. Feel free to ask for more details, but not sure what you may need.
    Rob

  • Rakshit, thank you very much for script! I need exactly the same in my site.

  • Rakshit, thank you very much for script! I need exactly the same in my site.

  • i want to sync wordpress users to phpbb. is it possible with this script?

Leave a Reply

Your email address will not be published.