943,678 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1281
  • C++ RSS
Nov 22nd, 2008
0

automating login to a server using c++

Expand Post »
C++ Syntax (Toggle Plain Text)
  1. am trying to login to a server, say my gmail account by sending it my username and password in a typical POST request. to make my life simpler
  2. i tested this code on www.campuser.net
  3. i was able to see the pages http requests using a firefox addon called tamper data to analyse their requests
  4. source code is attached
  5.  
  6. steps taken
  7. ----------------
  8. 1. connect to the server on port 80
  9. 2.send a simple GET request to see if stuff works well
  10. 3.attempt a login by sending password and username
  11.  
  12. the good news
  13. -------------------
  14. 1. connection was successful
  15. 2. GET / HTTP/1.1 request worked well
  16.  
  17. the bad news
  18. -------------------
  19. 1. the post was not sucessful and i have totally failed to see why
Attached Files
File Type: txt source code.txt (4.3 KB, 88 views)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
leowdeo is offline Offline
2 posts
since Jun 2008
Nov 22nd, 2008
0

Re: automating login to a server using c++

I don't know if this is the problem, but on the post request you have the terminating empty line after you have the post data.

C++ Syntax (Toggle Plain Text)
  1. Strcat(szSendBuffer,"/r/n);//the terminating empty line
  2.  
Reputation Points: 21
Solved Threads: 10
Junior Poster
Paul.Esson is offline Offline
181 posts
since Feb 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Parsing error
Next Thread in C++ Forum Timeline: Resizing of an array.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC