Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6112843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:47:27+00:00 2026-05-23T14:47:27+00:00

I want to have a non-Drupal website create a user account in my Drupal

  • 0

I want to have a non-Drupal website create a user account in my Drupal installation when a form is submitted. Is there a way to include (and otherwise initiate) the drupal APIs in a php script that is not inside a drupal module? I have tried including some include files as the “unknown function” errors keep coming up, but it has turned into a cat-and-mouse game.

Thank you for your help,
Jeff

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:47:28+00:00Added an answer on May 23, 2026 at 2:47 pm

    Yep, use services.module. It provides APIs for Drupal.

    Or:

    <?php
    
    chdir('/path/to/drupal/');
    require_once('includes/bootstrap.inc');
    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); 
    

    edit: Per the comments, for command-line usage, you have to spoof $_SERVER stuff that Drupal relies on (particularly the domain name):

    <?php
    
    // set some server variables so Drupal doesn't freak out
    $_SERVER['SCRIPT_NAME'] = '/script.php';
    $_SERVER['SCRIPT_FILENAME'] = '/script.php';
    $_SERVER['HTTP_HOST'] = 'example.com';
    $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
    $_SERVER['REQUEST_METHOD'] = 'POST';
    
    // act as the first user
    global $user;
    $user->uid = 1;
    
    // change to the Drupal directory
    chdir('/path/to/drupal');
    
    // Drupal bootstrap throws some errors when run via command line
    //  so we tone down error reporting temporarily
    error_reporting(E_ERROR | E_PARSE);
    
    // run the initial Drupal bootstrap process
    require_once('includes/bootstrap.inc');
    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
    
    // restore error reporting to its normal setting
    error_reporting(E_ALL);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a non-Drupal site which authenticates with a simple MySQL user database. I
I have a jQuery datepicker that I want to restrict non work days -
He want's to know our opinions on whether we should have flexitime, allow non-work
I want to have a text box that the user can type in that
I have two classes, and want to include a static instance of one class
We have a website that we want to provide web based API access to
I have a function which returns non-void. On the caller side, I want to
I have 2 non-transactional tables. I want to perform an 'insert' on one and
I have stored non-java files in a package. I want to read files from
I have a non-weighted DAG graph. What I want to do is to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.