Now I have some variables collected from POST
$a = $_POST['a'];
$b = $_POST['b'];
$c = $a * $b
I need to use them in 2 functions: hook_form() and the callback mail_send() the function that format and sends my email with form elements.
I have implemented the following hooks:
function MYMODULE_page() {...}
function MYMODULE_form() {...}
function MYMODULE_form_submit($form, &$form_state) {
mail_send($form_state['values']);
}
//a custom callback mail function call in the submit.
function mail_send($form_values) {}
...
Now I don't know where to place those variables to have maximum visibility:
- if I place them in MYMODULE_form() the show up in the form but they are not available in the mail_send().
- if I place them outside everything they are not available inside functions.
- if i place them inside a hook_init() the same as above.
I need a place where all variables are visible. Thanks