1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Create XenForo user account from PHP script

Discussion in 'XenForo Development Discussions' started by lol768, Nov 25, 2012.

  1. lol768

    lol768 Active Member

    I need to be able to create a new user account from a separate PHP script, that will be provided details e.g. username from GET variables.

    //Register account
    $fileDir './xf/';
    require (
    $fileDir '/library/XenForo/Autoloader.php');
    XenForo_Autoloader::getInstance()->setupAutoloader($fileDir '/library');
    XenForo_Application::initialize($fileDir '/library/'$fileDir);
    $request = new Zend_Controller_Request_Http();
    $session XenForo_Session::startPublicSession($request);
    $userModel XenForo_Model::create('XenForo_Model_User');
    //Create user here
    How would I go about doing this?
  2. Luke F

    Luke F Well-Known Member

    The Tapatalk bridge code is probably the best example of how to init and make calls to xenforo from an outside script
  3. lol768

    lol768 Active Member

    I'm able to edit user information and get info like alert numbers, but the registration code is quite complicated and designed for processing the registration form. The Tapatalk bridge doesn't include much code (if any) on registration.
  4. lol768

    lol768 Active Member

Share This Page