I have an application on which I have a button to call a piece of php to redirect to another application (2). This other application takes a global variable to select data from a table. If I call the application (2) from a link it all works well. But if I call it from a button nothing get’s selected. I checked the value of the global var before redirect it has the right value. So appearantly the global variables are not global? What am I doing wrong here? Do I need to pass a parameter perhaps on sc_redir? How do I do that so that the called application can pickup the global variable?
Similar Problem
Check this post.
http://forum.scriptcase.net/showthread.php?3474-Passing-parameters-using-HTML-Image-Link
I have similar problem. I set some global variable in the LOGIN app, but then when I call specific menu (based on who is logged in) the global variable is empty. I am using SMALLINT() it MySQL table, not sure if this might be a problem or something else.
Posted link in another post in this thread is dead
Yes this is true. I do this a couple of ways depending on what I need:
Within SC event onAfterUpdate / etc:
sc_set_global($payment_type);
sc_commit_trans();
sc_redir('payments');
Within buttons / ajax code / etc:
sc_redir(user_form_setup, id={rs[0][0]}, "_parent" );
or
$redir_param = array( // Param list, add as many as needed
'form_id' => [cert_form],
);
sc_redir('certificate_affiliate',$redir_param,'_self');