Hello everybody,
I've been reading up last night on the fascinating topic of Forms, it was all very interesting and elegant, but today I have tried to submit a form from my own code and I got nothing...
I recorded a Form submission using the Devel Module and tried to submit that with(unsuccessfully), could someone tell me what I've been doing wrong?
Here is my code:
<?php
function myCreateBookForm($title,$body,$parent=-1)
{
$macro[1]['form_id'] = 'book_node_form';
$macro[1]['path'] = 'node/add/book';
$macro[1]['values'] = array (
'nid' => NULL,
'vid' => NULL,
'uid' => '1',
'created' => 1203760494,
'type' => 'book',
'language' => 'en',
'changed' => '',
'title' => $title,
'teaser_js' => '',
'teaser_include' => 1,
'body' => $body,
'format' => '1',
'revision' => 0,
'log' => '',
'name' => 'Agony',
'date' => '',
'status' => 1,
'promote' => 0,
'sticky' => 0,
'op' => 'Save',
'submit' => 'Save',
'preview' => 'Preview',
'form_build_id' => 'form-e6ea47946acd14f590ccf6ef21f8dc6c',
'form_token' => 'c568db823f084774b4cb427d508e763c',
'form_id' => 'book_node_form',
'book' =>
array (
'menu_name' => '',
'mlid' => 0,
'nid' => 'new',
'router_path' => 'node/%',
'has_children' => 0,
'options' =>
array (
),
'module' => 'book',
'original_bid' => 0,