[support] Best way to post content from PHP

Errol Sayre errol.sayre at gmail.com
Thu Aug 14 20:47:07 UTC 2008


On Aug 14, 2008, at 3:36 PM, Michael Prasuhn wrote:
> if ($node['title']) {
>  $node = (object)$node;
>  $node = node_submit($node);
>  node_save($node);
>
>  $nid = $node->nid;
>
>  $message = 'Saved as node id '. l('#'. $nid, 'node/'. $nid);
>  drupal_set_message($message);

Expanding on this idea, is there any formal API for creating a node  
externally and passing it off to Drupal? How would I access a custom  
module like this programmatically on the same server? I had assumed  
I'd have to go through some web frontend on drupal to get access to  
things in the proper context...


More information about the support mailing list