sc_redir help

Can some one help with this issue, I am using the sc_redir macro below but cannot get this to display in a modal. I get no error message just a a new tab web page.

$redir_app=‘https://www.momandpop.com/stategrid/dir/’; // Application
$redir_param="{ADDRESS}, {CITY}, {STATE}. {ZIP}";// Param list, add as many as needed

sc_redir($redir_app.$redir_param, “modal”, 700, 800);

Hi Dr Tim - It is because you are trying to open a “https” link from within a “http” and iframe block the opening of the secure page.I think!
Andy

The syntax you’re using seems wrong.

The correct syntax is:

sc_redir(Application, Parameter01; Parameter02, Target, Error, height_modal, width_modal)

So your code should be:

sc_redir($redir_app[SIZE=18px],[/SIZE]$redir_param, "modal"[SIZE=18px], ""[/SIZE] ,700, 800);

But double check your $redir_param as well.
Multiple parameters should be semicolon separated.
Like this:

sc_redir(employee.php, parm1={var_test}; parm2="xxx", "_blank");

I have tried these changes and I get an error if I add the ; in the following example:

sc_redir(Application, Parameter01; Parameter02, Target, Error, height_modal, width_modal)

in my code example everything works except the modal

$redir_app=‘https://www.momandpop.com/stategrid/dir/’; // Application
$redir_param="{ADDRESS}, {CITY}, {STATE}. {ZIP}";// Param list, add as many as needed

sc_redir($redir_app.$redir_param, “”, “modal”, 700, 800);

So i am still looking for a answer to this problem.

Dr Tim

My guess is that using the dot between the first two variables is making PHP join the variables. If so, to the SC macro you’re actually passing less paramaters that you think and shifted by one position.

So yours:


sc_redir($redir_app.$redir_param, "" , "modal" , 700 , 800);

is parsed as:


sc_redir(
$redir_app.$redir_param,  <-- Application
"",                       <-- Parameter
"modal",                  <-- Target
700,                      <-- Error
800                       <-- height_modal
                          <-- width_modal (missing parameter)
);

If my theory is correct, you should be able to fix it like this:


sc_redir($redir_app.$redir_param , "" , "modal" , "" , 700 , 800);

that wil get parsed as:


sc_redir(
$redir_app.$redir_param,  <-- Application
"",                       <-- Parameter
"modal",                  <-- Target
"",                       <-- Error
700,                      <-- height_modal                  
800                       <-- width_modal                  
);

After make the changes I still have no modal, I even copied your line of code in and still same result. This must be a bug in Scriptcase.

I have no other explanation.

Dr Tim

@robydago

I have added another param as documentation shows but still have same results, it works for full page but no modal. Using ; I still get errors when trying to run the application.



$redir_param="{ADDRESS}"; // Param list, add as many as needed
$redir_param1="{CITY}, {STATE}. {ZIP}"; //Param List for City, State, Zip

sc_redir($redir_app.$redir_param.$redir_param1 , "modal" , "" , 600 , 700);


Tim,

you have NOT added any new parameters to sc_redir.

Unless the SC parser is doing something unexpected, your

$redir_app.$redir_param.$redir_param1

will count as one single parameter because PHP will merge it as:

'https://www.momandpop.com/stategrid/dir/{ADDRESS}{CITY}, {STATE}. {ZIP}'

So the whole sc_redir will be:

sc_redir("https://www.momandpop.com/stategrid/dir/{ADDRESS}{CITY}, {STATE}. {ZIP}" , "modal" , "" , 600 , 700);

So still one missing parameter, as only comma separated strings\variables will count as parameters.

This example does not work at all, I have played around with it and cannot make it work at all. I keep getting T-String errors when I try to run.