I'm looking to use the system (or exec) function to call a shell
script in UNIX. The following is the UNIX command line without PHP:
/home/public_html/VariableDirectory/myScript.ksh
VariableDirectory can be a number of different directories. Each of
them contain a copy of myScript.ksh.
So, we run the same script in different directories like this:
/home/public_html/FirstDirectory/myScript.ksh
and
/home/public_html/SecondDirectory/myScript.ksh
Now, regarding PHP:
I'm looking to have the web-user decide in which VariableDirectory
he/she wants to run myScript.ksh. Therefore, I'm looking to have a
system() call which looks something like the following:
system("/home/public_html/'".$_REQUEST[directory]."'/myScript.ksh");
However, this doesn't work. I've also tried to save
$_REQUEST[directory] as another variable and call it within the path.
For example,
$theDir = `echo $_REQUEST[directory]`;
system("/home/public_html/$theDir/myScript.ksh");
This doesn't work either. Does anyone know about the syntax for this
example of a system() call?
Thanks,
Cam