How to pass the nid from hook_node_view to the submit function? I need one button at the end of one content type view form. This button should redirect the user to another page.

I have something like the following code:

function mymodule_node_view($node, $view_mode, $langcode) {

    if ($node-&gt;type == 'my_type') {
            $form = drupal_get_form('redirect_button_form');
            $node-&gt;content['redirect_button'] = $form;
            //$node-&gt;nid is the data I need in the submit function
    }
 }

function redirect_button_form($form, &amp;$form_submit) {
    $form['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt; t('Redirect button text'),
    );
    return $form;
}

function redirect_button_form_submit($form, &amp;$form_state) {
    $path = 'mypath';
    $options = ****I need the nid here;
    drupal_goto($path,$options );
}


How can I pass the nid from the hook_node_view to the submit function?
You don't need to use form here. Just use l() with the button name and the link path.

function mymodule_node_view($node, $view_mode, $langcode) {

if ($node-&gt;type == 'my_type') {
   $node-&gt;content['redirect_button'] = array(
     '#markup' =&gt; l('Redirect button', 'yourpath/' . $node-&gt;nid);
   );
    }
}