How to get the $form_state in hook form submit? I need to create a node when a comment is submitted in nodes. There are two content types image and memory and I need to get node ID of the node that a user is inserting comment in it.

Here is my code

function THEME_form_submit(&amp;$form_state, $form_id){
    if($form_id == "comment_node_memory_form" || $form_id == "comment_node_image_form"){
        kpr($form_state);
        //Insert new node 
    }
}


Clearly this code won't display the $form_state but I need to some how get the node ID and the ID of the user who inserting the comment. I guess these information are in $form_state but I really have no idea how to get them.

Thanks
If you only need nid of node comment is being inserted inside and uid of comment author then use these codes :

nid exist in : $form_state ['values']['nid']

you can even load node if you need more info about it using : 

$node = node_load($form_state ['values']['nid']);


to get info about author use : $form_state ['values']['uid']

if user is anonymous this returns 0