This just simply sends the char* Version = "Version 1.0" text to the php script witch _GETs it and writes it to a file. Simple and impractical, however I just wanted to get something rolling. It works fine, now I need to do the opposite.

I need to do exactly what this function does, but flip it around!. I want store a value in the php script, and get that value with my C++ application, and then log it out. Any help here please!?

I need to query the php script from my C++ application and retrieve the value of $version. How can I setup the php script to export that value $version for the C++ app and use the WinInet funcs to retrieve it?

Note: I am just trying to get a feel for how all of this works right now, so none of this really has a practical use at the moment, but is helping me progress in my overall goal, so it will be very helpful to get this worked out.

I realize there are better ways to accomplish something like this witch I will look into later, for now I want to get this worked out if someone can direct me.

Re: php variable to C++ application

Posted 17 February 2011 - 01:55 PM

You're using WinInet, so after sending your request, use InternetQueryDataAvailable to get the number of bytes coming back, allocate a buffer large enough to accommodate the data, and use InternetReadFile to get the data into the buffer.

Re: php variable to C++ application

Posted 17 February 2011 - 02:01 PM

JackOfAllTrades, on 17 February 2011 - 01:55 PM, said:

You're using WinInet, so after sending your request, use InternetQueryDataAvailable to get the number of bytes coming back, allocate a buffer large enough to accommodate the data, and use InternetReadFile to get the data into the buffer.

Ok, thanks for the information. I will give it a shot and see what I come up with.

Re: php variable to C++ application

Posted 17 February 2011 - 03:01 PM

Ted Copple, on 17 February 2011 - 02:01 PM, said:

JackOfAllTrades, on 17 February 2011 - 01:55 PM, said:

You're using WinInet, so after sending your request, use InternetQueryDataAvailable to get the number of bytes coming back, allocate a buffer large enough to accommodate the data, and use InternetReadFile to get the data into the buffer.

Ok, thanks for the information. I will give it a shot and see what I come up with.

Hmm, still stuck at a wall here. Is "buffer" supposed to hold the value that I need?