helpmewithPHP
New member
Hi,
I'm using php's exec function to call an executable that I'd like to run. I'm doing it like this:
<?php exec("myExe Bob 123");?>
and then 'myExe' will run and accept "Bob" and "123" as parameters and this works fine. But what I'd like to do is make the params variables, like this:
$name = "Bob";
$IDnum = "123";
<?php exec("myExe $name $IDnum");?>
But this doesn't work, it doesn't seem like I can use $ in the string like that. Can someone please tell me the syntax I need? I should mention I'm writing this in a JavaScript callback function, if that makes a difference.
I'm using php's exec function to call an executable that I'd like to run. I'm doing it like this:
<?php exec("myExe Bob 123");?>
and then 'myExe' will run and accept "Bob" and "123" as parameters and this works fine. But what I'd like to do is make the params variables, like this:
$name = "Bob";
$IDnum = "123";
<?php exec("myExe $name $IDnum");?>
But this doesn't work, it doesn't seem like I can use $ in the string like that. Can someone please tell me the syntax I need? I should mention I'm writing this in a JavaScript callback function, if that makes a difference.
Last edited: