views:

38

answers:

1

Dear PHP and Qt experts,

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?

+2  A: 

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

Paul Dixon
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
In QT app something like `string answer = GetHttpPage("http://site.com/is_even.php?number=" + number);` and PHP: `echo IsEven(_GET["number"])`
adf88
How to send the number with POST, not with GET?
Narek
@Narek: maybe you should read a PHP Book first.
nebukadnezzar