用于c ++代码的Web前端

I have c++ code that can be compiled under Linux, windows or Mac OS. The code compares two images. I would like to have its front end running on a browser and make available to the www.

I am familiar with hosting and dns and that is not the issue. what I can't seem to figure out is:

  1. How do I invoke the script once the image is uploaded by users?

  2. The results from the code needs to be displayed back to the browser. How can a callback be set up for this?

Is there a php solution? Or python (with flask)?

You can either call the C++ application from PHP with exec and then return to browser whatever result is there. This is quick and not good idea. Better approach is to have a service/daemon in C++ running and taking tasks from queue (like RabbitMQ for example). This is scalable solution but requires more effort to implement.

Why don't use CppCMS (http://cppcms.com/) ? CppCMS is a Free High Performance C++ Web Development Framework.

You can use it to handle HTTP request and file upload and easily integrate your code...

You can use sockets, and start listening on some port from C++ program, then from PHP you can connect and send/receive data to/from your program.