Note that there are some explanatory texts on larger screens.

plurals
  1. POQT Network reply won't give me back result from PHP script
    primarykey
    data
    text
    <p>Hi all I have one problem. I am connecting QT with php script..Everything works fine, but can somone help me how to receive php result from it. here is my code : </p> <pre><code>void MainWindow::Dodaj_korisnika(QUrl url) { //reply = qnam.get(QNetworkRequest(url)); //////////////////////////////////////////////////// QUrl params; params.addQueryItem("action","Dodaj_korisnika"); params.addQueryItem("ime",ui-&gt;lineEdit); params.addQueryItem("prezime",ui-&gt;lineEdit_2); params.addQueryItem("broj",ui-&gt;lineEdit_3); params.addQueryItem("adresa",ui-&gt;lineEdit_4); QByteArray data; data.append(params.toString()); data.remove(0,1); QNetworkRequest request; request.setUrl(url); request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/x-www-form-urlencoded")); QNetworkAccessManager *manager = new QNetworkAccessManager(this); QNetworkReply *reply = manager-&gt;post(request, data); connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*))); } </code></pre> <p>And I have found on forums that I need to use this function:</p> <pre><code>void MainWindow::replyFinished(QNetworkReply *reply) { QString data = reply-&gt;readAll().trimmed(); // document.setContent(reply); } </code></pre> <p>But ofc I am not getting anything into this function..Is it possible to read from QT manager variable? I am receiving xml result. And I want to put it as QDomDocument is that possible? Please give me some hint or some example if you have some time.. Thank's all!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload