2

I want to create a Qt application that takes a random integer and sends to the server to a specific file (say to process.php) in order to that file to answer to that Qt application if the number is odd or even. And when the Qt application gets the answer from the process.php, it gives a message box that tells the server answer.

Will be great if you provide me with a code, but references and hints will be appreciated too.

BTW this will help me to create some licensing for my software. If this is for licensing the I should use https? Does it change something in c++ or php code?

Narek
  • 38,779
  • 79
  • 233
  • 389

1 Answers1

3

Take a look at Qt how can I get content of a page web for some examples of how to perform a fetch in QT

Community
  • 1
  • 1
Paul Dixon
  • 295,876
  • 54
  • 310
  • 348
  • If in php file I return true/false, the the "str" in your example will contain the value, or I should generate html by php in order to be "clear" for QNetworkAccessManager class? – Narek Aug 15 '10 at 08:02
  • In QT app something like `string answer = GetHttpPage("http://site.com/is_even.php?number=" + number);` and PHP: `echo IsEven(_GET["number"])` – adf88 Aug 15 '10 at 08:56
  • How to send the number with POST, not with GET? – Narek Aug 15 '10 at 11:40