Create node from custom form using ajax
in drupal you can create node using node_save function as below   

$node = new StdClass();//creating a bare node
$node-&gt;type = 'answer';//giving it type
$node-&gt;status = 1;//give it a published staus
$node-&gt;title = "Step up to the FLava";//gives title
$node-&gt;body = "Body Body body"; //gives body

node_save($node);
//save it and give it the rest of the attributes`