How do I add a node from a custom form using ajax? I want it to be submitted in the backend. How will it be if there are custom fields?
in drupal you can create node using node_save function as below
$node = new StdClass();//creating a bare node $node->type = 'answer';//giving it type $node->status = 1;//give it a published staus $node->title = "Step up to the FLava";//gives title $node->body = "Body Body body"; //gives body node_save($node); //save it and give it the rest of the attributes`