PHP system() args

marjoriewald

New Member
I have the following code that executes a C++ program and outputs it:\[code\]<html> <head> <title>C++</title> </head> <body> <div><?php system("app.exe", $out); echo rtrim($out, "0"); ?></div> </body></html>\[/code\]How can I make it so that you can pass arguments to the c++ program, say like this...If this was the c++ program\[code\]#include <iostream>#include <string>int main(){ string input = getarg();//Not really a function, just one I kinda want to know cout << input; return 0;}\[/code\]Could I do something like this?\[code\]<html> <head> <title>C++</title> </head> <body> <div><?php system("app.exe arg=hello-world", $out); echo rtrim($out, "0"); ?></div> </body></html>\[/code\]I don't know a lot of parts to this problem, I can execute the program but I just need to pass arguments.
 
Back
Top