I have following setup in Drupal 6:
Node Content Type: uprofile
Fields: field group: group_about with fields field_about_me, field_programinfo
I am creating a node using the following logic:
$node = new stdClass();
$node->title = trim($name);
$node->type = 'uprofile';
$node->created = time();
node_save($node);
I tried to save node using various methods, but all of them were futile, here is the one way I tried this(from drupal site):
$form_state = array();
module_load_include('inc', 'node', 'node.pages');
$form_state['values']['type'] = 'uprofile';
$form_state['values']['status'] = 1;
$form_state['values']['op'] = t('Save');
$nodetype = array('type' => 'uprofile');
$form_state['values']['title'] = trim($name);
form_state['values']['field_about_me'][0]['value'] = trim($name);
$form_state['values']['field_programinfo'][0]['value'] = trim($name);
drupal_execute('uprofile_node_form', $form_state, (object)$nodetype);
This had no effect, and I am out of ideas on this. Can anyone please guide me in the right direction.
Thanks.