I was wondering what would be the best method for creating a web end for interfacing with a C++ program on the server. At first I simply thought just using shell execution from the web server side language (like shell_exec() in PHP), but I was wondering if there is a better way. Maybe something more native or is this a bad practice for some reason?
Creating a web-end for a C++ program
php;c++;web applications
Web programming with C++ has pretty much gone out of style. The traditional way to do it was with CGI. See here for a tutorial.Or you can add an embedded webserver like mongooseHowever, I think it's easiest to use PHP's passthru. For example, on one of my sites I have a C++ program that generates images, to display the images I do:<?header(content-type: image/png); $temp = $_GET[temp];$rain = $_GET[rain];passthru(/home/rrabien/marker $temp $rain)?>