Mark40302
asked on
Sending/receiving vars between a C++ program and PHP file
Hello everyone,
I was wondering how to send variables inside a C++ program (running as a client) to a PHP file on a server without having an Internet browser pop up. I would like the PHP file to process the data and do something with it, like add it to a MySQL database. Does anyone know how to write a C++ program that sends some variables to a PHP file?
Also, does anyone know how to make the PHP file send something useful (like the contents of a MySQL database) back to the C++ program? I'm going to assume that my second question is more difficult.
-Mark
I was wondering how to send variables inside a C++ program (running as a client) to a PHP file on a server without having an Internet browser pop up. I would like the PHP file to process the data and do something with it, like add it to a MySQL database. Does anyone know how to write a C++ program that sends some variables to a PHP file?
Also, does anyone know how to make the PHP file send something useful (like the contents of a MySQL database) back to the C++ program? I'm going to assume that my second question is more difficult.
-Mark
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry,
forget this line:
m_UserName.Empty();
It is from my own source code.
forget this line:
m_UserName.Empty();
It is from my own source code.
ASKER
Thanks a lot jaime_olivares, your code worked. I set the url string to a value, changed m_pSession to pSession, deleted the last two parameters of the OpenURL function (and used their default values) since they were both causing problems, and got the program to run successfully on my first try. I accepted your code since it worked so nicely.
Also, thanks efn for the links because they informed me of a lot other free libraries I might have to use later, like zlib and OpenSSL.
Also, thanks efn for the links because they informed me of a lot other free libraries I might have to use later, like zlib and OpenSSL.
ASKER
I'm not sure where to start. Do you know how to make programs with curl or libcurl? Also I wasn't sure if I was going to end up using curl as an imported library, DLL, or an exe. The Win32 section of downloads only seemed to have an exe (but I could be wrong).