WinINet problem

Hello everybody ,
i'm a beginner programmer and this is the first time that i open a topic.

I have to do a program that send data to a php page.
I write this code but , when i run it , it lunch the exception.
Where is the error?

This is the code :

CString strHeaders = _T("Content-Type: application/x-www-form-urlencoded");

CString strFormData = _T("name=John");
try{
CInternetSession session(_T("Session1"));
CHttpConnection* pConnection =
session.GetHttpConnection(_T("www.sito.com/prova.php"));
CHttpFile* pFile =
pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST,
_T("name"));
BOOL result = pFile->SendRequest(strHeaders,
(LPVOID)(LPCTSTR)strFormData, strFormData.GetLength());
}

catch(CInternetException* pEx) {

}


P.S. : sorry for my horrible English
Topic archived. No new replies allowed.