Hi,
I am attempting to access the Drupal data from an external php script..
I am able to connect to drupal with the following..
//Bootstrap Drupal $drupal_path = '/var/www'; chdir($drupal_path); //Path to drupal $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; define('DRUPAL_ROOT', $drupal_path); require_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
So that's fine..
Now I am trying to access content that doesn't have anonymous view access so I need to authenticate the external script somehow..
Can anyone point me in the right direction as to what API's I need to use to authenticate to drupal in order to access the content?
Thanks..
On Sat, Jun 16, 2012 at 11:21 AM, Wipe_Out wrote:
Hi,
I am attempting to access the Drupal data from an external php script..
I am able to connect to drupal with the following..
//Bootstrap Drupal $drupal_path = '/var/www'; chdir($drupal_path); //Path to drupal $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; define('DRUPAL_ROOT', $drupal_path); require_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
So that's fine..
Now I am trying to access content that doesn't have anonymous view access so I need to authenticate the external script somehow..
Can anyone point me in the right direction as to what API's I need to use to authenticate to drupal in order to access the content?
$user = user_load(1);
Or what ever user you think would be best.
http://api.drupal.org/api/drupal/modules%21user%21user.module/function/user_...
On 16 June 2012 16:40, Earnie Boyd earnie@users.sourceforge.net wrote:
$user = user_load(1);
Or what ever user you think would be best.
http://api.drupal.org/api/drupal/modules%21user%21user.module/function/user_...
Perfect.. Thanks..