Options for connecting program written in C++ to webpage

  ajax, c++, html, web-applications, web-hosting

I have a program written in C++. It makes use of the third party library GMP. I would like to somehow make it accessible through a webpage. I was thinking of CGI because the input to the program is a string of text, and the output is a string of text. Then Ajax and DOM can be used to update the webpage without the need to reload it. Am I on the right track? Is there a more modern alternative to CGI? What should I look for in a web host to make sure it supports these things? For example can a content management system (such as Drupal or Joomla) even support CGI?

Source: Windows Questions C++