I've implemented hook_menu roughly as follows:
function sample_menu() {
return array(
'path/to/things' => array(
'page callback' => 'callback_function',
'access arguments' => array('access content'),
'page arguments' => array(),
'type' => MENU_CALLBACK
)
);
}
I want to be able to post data to this url. So says $_POST is the following array:
array(
'data1' => 'value1',
'data2' => 'value2',
)
How can I access $_POST['data1'] and $_POST['data2'] inside the callback? Directly accessing $_POST seems to not work (it's var_dumped as empty).