I want to do something after I submit the node. How can I do that?
I use hook_form_form_id_alter(),but I dont know how to use callback function called after the user submit the form
function mymodule_form_node_form_alter(&$form,&$form_state,$form_id)
{
if($form['#node']->type=="my_content_type")
{
$form['actions']['submit']['#submit'][]=my_callback_function;
}
}
function my_callback_function($form,$form_state)
{
//my code here!!
//execute after the user submit the node form
//and then redirect user to another place,after executing the code above
}
it doesn't work! and I don't know why? Please tell me how can I do that?