Results 1 to 2 of 2

Thread: How to Login using QNetworkAccessManager?

  1. #1
    Join Date
    Jun 2008
    Location
    Rome, Italy
    Posts
    95
    Thanks
    19
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Question How to Login using QNetworkAccessManager?

    Hi to all,
    I've seen some posts about QHttp and QNetworkAccessManager working on connections, the last seems to be the best solution but I've not found example on the Login action.
    I'd like to login in a classic login_page.php as follow:

    Qt Code:
    1. <form name="login_form" method="post" action="login.php">
    2. <table class="width50" cellspacing="1">
    3. <tr>
    4. <td class="form-title">
    5. Login </td>
    6. <td class="right">
    7. </td>
    8. </tr>
    9. <tr class="row-1">
    10. <td class="category" width="25%">
    11.  
    12. Username </td>
    13. <td width="75%">
    14. <input type="text" name="username" size="32" maxlength="32" />
    15. </td>
    16. </tr>
    17. <tr class="row-2">
    18. <td class="category">
    19. Password </td>
    20. <td>
    21.  
    22. <input type="password" name="password" size="16" maxlength="32" />
    23. </td>
    24. </tr>
    25. <tr>
    26. <td class="center" colspan="2">
    27. <input type="submit" class="button" value="Login" />
    28. </td>
    29. </tr>
    30. </table>
    31. </form>
    To copy to clipboard, switch view to plain text mode 

    Should you suggest a simple QNetworkAccessManager authentication code?
    THANKS!!!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to Login using QNetworkAccessManager?

    You just need to form a proper POST request. There are dozens of web-pages saying how to do that. You can even use a network sniffer to see how the request should look like.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Login to www.getfile.pl
    By oski225 in forum Qt Programming
    Replies: 7
    Last Post: 20th August 2009, 17:55
  2. Suggestions on Login Prompt
    By fnmblot in forum Qt Programming
    Replies: 9
    Last Post: 22nd May 2009, 19:54
  3. Login Problem
    By srichand in forum Qt Programming
    Replies: 1
    Last Post: 9th May 2008, 12:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.