Entry
How do I call a c program from php, it has to pass a string with it and have ti return a string?
Feb 28th, 2007 02:35
Articles Way, Nate Weibley,
I suspect you want to use exec()
example...
C++ program:
#include <stdio.h>
void main(int argc, char *argv[]) {
printf("Your command line arguemnts: ");
for(int i=1;i<argc;i++) printf("%s",argv[i]);
}
php script:
<?php
exec("/path/program i am a cow",$lines);
foreach($lines as $theline) echo $theline."\n";
?>
That would simply output:
Your command line arguments: i am a cow
I think.
--Nate
Email: iamfast@tampabay.rr.com
=======
thescripts.com/forum/thread592791.html
i hope that helps.
http://americanahost.com
http://www.qwesz.com