How to know if i click any link in drupal and set a variable? I need some help for the following case:

In my content-type i have a cck link that redirect to another page.
So, i need do this:

When, i click in the link.. In my content-type_form ([name_content_type]_node_form) i need to extract a variable of this form of my node:

form_state['values']['id'] = $id; 
variable_set($id, 1);

Then, when i stay in the another page (that is a form) ; in this form do: 

$form['id'] = array(
        '#type' =&gt; 'textfield',
        '#default_value' =&gt; variable_get($id, 1)
);


for view the corresponding id.

How to do this?
As I understand it, you need to pass a value via the URL, and fix a forms element based on this.

You have to output a link ith your variable in it, in the form yoursite.com?variable=value, preferably via the l() function.

On your second page, the value will be accessible in several ways, for example in the $_GET variable.

More powerfull and Drupalish, you could also implement a hook_menu to be able to use clean URLs like yoursite.com/some_menu_entry/yourvalue and the corresponding function.