Please help me to get out of the creative impasse:

An application in C ++ checks its version with the information about the latest version, which is stored in the database on the hosting.

How to return information to PHP to the application (because it is not a browser)? And what should be the minimum set of parameters in the POST request header when sending to the server (the client sends the version number and its description)?

  • A softina GET request gets server.com \ currentversion.php version number with a string of type "7.00.123456". Here, in general, and all. - Vladimir Martyanov
  • In PHP, how to give the answer to the network? Just echo $ version or how? - Iceman

2 answers 2

Wrote a wrapper class https://github.com/sitev/cjWinHttp to access sites in the C ++ program, maybe it will be useful to you =)

  • Thank! I found out that there is WinHTTP other than sockets ... But the PHP question is still open - how can I return the value to the application (not the browser) in a PHP script? Will a simple echo be enough or not? - Iceman
  • one
    Yes, sure enough! - sitev_ru

One of the possible options: The C ++ program makes an http request to the php script. The PHP script performs the necessary manipulations with the database, forms the answer and sends it in json (xml) format. The C ++ program receives this response and parses json (xml) in an easy-to-use form.

  • Well, yes, such a scenario is planned, though without json - you just need to return the string "Run" or "Close" ("1" or "0") so that the client either starts or displays the MessageBox "It is necessary to update" and close. How to return from PHP to the application - just echo, or not? - Iceman