webguy22
Member
This is a followup to topic http://www.gdgsoft.info/how-section-f41/can-pass-parameters-the-exe-t2456.html
First, I placed the above PHP code at the top of my PHP file right after session_start();:
<?php print_r(exo_return_hescriptcom("MyScript.GetPassedParameter|1","HESCRIPT_MISSING")); ?>
And added the script to the compile:
function GetPassedParameter(p_iIndex:Integer): String;
begin
Result := ParamStr(p_iIndex);
end;
When running the exec, I receive:
Fatal PHP Error: Script not found: MyScript
This is probably a simple/dumb solution. Not sure what else to do with “MyScript”.
But my real issue is reloading the exec within a form.
Example:
Have abc.php. There’s an HTML form inside with two selection inputs. When you enter the first selection input, the second is auto-filled with values based the the first selection. For example, the first selection is to choose a folder. Once that is chosen, the second selection is filled with list of files from that folder. I use onchange to reload the form and pass it a query.
function reload(form)
{
var val1=form.folder.options[form.folder.options.selectedIndex].value;
self.location=‘abc.php?folder=’ + val1 ;
}
When the form is reloaded, I know the folder name and run code to capture the files from the folder and place them in the second input selection.
I believe this is pretty normal stuff when handling fields that you wish to repopulate based on previous input.
This leads me to why I’m trying to pass parameters to the exec file. See the javascript funtion. If I can get the passing parameters to work, would I change the call to “self.location=‘abc.exe?folder=’ + val1;” ? Or something else? Can I even do this query? Should I pass the parameter a different way?
Thanks
First, I placed the above PHP code at the top of my PHP file right after session_start();:
<?php print_r(exo_return_hescriptcom("MyScript.GetPassedParameter|1","HESCRIPT_MISSING")); ?>
And added the script to the compile:
function GetPassedParameter(p_iIndex:Integer): String;
begin
Result := ParamStr(p_iIndex);
end;
When running the exec, I receive:
Fatal PHP Error: Script not found: MyScript
This is probably a simple/dumb solution. Not sure what else to do with “MyScript”.
But my real issue is reloading the exec within a form.
Example:
Have abc.php. There’s an HTML form inside with two selection inputs. When you enter the first selection input, the second is auto-filled with values based the the first selection. For example, the first selection is to choose a folder. Once that is chosen, the second selection is filled with list of files from that folder. I use onchange to reload the form and pass it a query.
function reload(form)
{
var val1=form.folder.options[form.folder.options.selectedIndex].value;
self.location=‘abc.php?folder=’ + val1 ;
}
When the form is reloaded, I know the folder name and run code to capture the files from the folder and place them in the second input selection.
I believe this is pretty normal stuff when handling fields that you wish to repopulate based on previous input.
This leads me to why I’m trying to pass parameters to the exec file. See the javascript funtion. If I can get the passing parameters to work, would I change the call to “self.location=‘abc.exe?folder=’ + val1;” ? Or something else? Can I even do this query? Should I pass the parameter a different way?
Thanks
Last edited: