By unkus_nob on
Hello, I have problems to pass a simple variable as a parameter to a function.
I have the following code:
function prova_submit($form, &$form_state){
$fi = $form_state['values']['filtro'];
drupal_goto('tablePage');
fiY=tablePage($fi)
}
function tablePage($fiY){
var_dump($fiY)
}
Doing this, the var_dump($fiY) is NULL and
Warning: Missing argument 1 for tablePage(),
How can I pass the variable into the tablePage?
Thanks in advance
Stefania
Comments
This code does not look
This code does not look good...
1st of all, this line:
fiY=tablePage($fi)what is fiY ? if should be $fiY.
second of all to use
drupal_goto, you need to define a menu item first - you cannot usedrupal_gotowith a function ...then: I don't thing that any code will be executed after drupal_goto call because it calls
drupal_exit($url);and that function hasexit;in it, which will terminate the script...take a look at these articles:
http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_go...
http://api.drupal.org/api/drupal/includes--menu.inc/group/menu/7
http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...
Hmm, I'm not quite sure what
Hmm, I'm not quite sure what you're trying to do here, but I'll take a guess that you're trying to do some submission tasks in the tablePage() function.
I have not done much C before, but drupal_goto is a function to redirect the user's browser. It does not work the same as goto in other languages.
Try something like this:
----------------------
Nick Santamaria