Connecting to a php file

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: May 2008
Posts: 99
Reputation: FTProtocol has a little shameless behaviour in the past 
Solved Threads: 1
FTProtocol FTProtocol is offline Offline
Junior Poster in Training

Connecting to a php file

 
0
  #1
Dec 1st, 2008
Hey,

Just wondering how i would go about connecting to a php file from a console based app.

Any ideas would be greatly appreciated.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 99
Reputation: FTProtocol has a little shameless behaviour in the past 
Solved Threads: 1
FTProtocol FTProtocol is offline Offline
Junior Poster in Training

Re: Connecting to a php file

 
0
  #2
Dec 1st, 2008
cant edit sorry for the double post

  1. int main()
  2. {
  3. SOCKET s;
  4. WSADATA wsadata;
  5. SOCKADDR_IN target;
  6.  
  7. WSAStartup(0x0202, &wsadata);
  8.  
  9. target.sin_family = AF_INET;
  10. target.sin_port = htons (80);
  11. target.sin_addr.s_addr = inet_addr ("http://anonserver.org/rapid/submit.php?");
  12.  
  13. s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
  14. connect(s, (SOCKADDR *)&target, sizeof(target));
  15.  
  16. sprintf(szBuffer, "u=?&p=?");
  17.  
  18. send(s, szBuffer, strlen(szBuffer), 0);
  19.  
  20. closesocket(s);
  21. WSACleanup();
  22.  
  23. return 0;
  24. }

not working
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC