Menu
I’m adapting someone else’s code to run on my site.
A C program should be run using exec() but it seems to not work.
The code is like this:
[code=php]…
$_pg = $_SERVER[‘DOCUMENT_ROOT’].”/path/cprogram”;
$_p = $_params[‘p’] * 1000;
$_stmt = “{$_pg} 3 {$_p} {$_params[‘t’]}”;
$_line = exec($_stmt);
When I print_r($_line) it is an empty array, meaning its not working. The original code works on the same server, but I had to change a lot of that code.
I think the problem is with the line stating $_stmt. I havent seen that syntax of “{…}” before. Is there another way to write that?