PDA

View Full Version : A way for qt to read the string returned from my php script on the web



Ericode
12th April 2015, 21:31
Hello, I am using php 5.5 encryption for my mysql database and I am trying to send the password the user enters to the php script and see if it matches the hash in the database. I am not sure of the best way to do this. I was looking at using QNetworkAccessManager but how would I send what the user writes to the php script on the web? Any other suggestions or comments would be greatly appreciated. Thanks.

anda_skoa
13th April 2015, 08:15
If the user writes something on the web, i.e. in a web browser, then this browser alone is going to get the response for that request.
A TCP connection and the HTTP connection on top are a two sided channel, only the two parties involved (browser and web server) have access to the data (especially if the connection is encrypted).

In case your program is the client, e.g. using QNetworkAccessManager, then it will receive the response to the request it made.

Cheers,
_

jefftee
13th April 2015, 08:24
You can use QNetworkAccessManager::post to send an encrypted HTTP request (https://example.com/your.php) and pass the data along with the request by passing a QByteArray as the 2nd parameter to QNetworkAccessManager::post.