I created my very first C++ programAnd now I want to call it from PHP. The problem that I have is that the inputs are on different lines. I.E.:
How can I run an exec() function to fill in those inputs? I tried variations of:Code:program.exe What's your name: <name> What's your username: <username> output here
andCode:echo exec("cd path/to/program/ && program.exe\nJas\nJas\n");
But it doesn't work. Any thoughts?Code:$out = array(); echo exec("cd path/to/program/ && program.exe\nJas\nJas\n",$out); print_r($out);
If this won't work, is there an alternate way to input those without using a flat file or putting all the vars on one line?



And now I want to call it from PHP. The problem that I have is that the inputs are on different lines. I.E.:
Reply With Quote
)
Bookmarks