POSTing to a PHP script
I'm having trouble POSTing variables to a PHP script using WinInet. Here is the code:
The return codes from the functions are all good. However, in printpostvariables.php, which WILL print any variables sent to it by the POST command, it cannot find the 'message' or 's' variables. Is the format of my buffer incorrect? If not, what IS happening?
hRequest=HttpOpenRequest(hConnect, "POST", "printpostvariables.php" ,
NULL , NULL, NULL, NULL , NULL );
HttpSendRequest(hRequest,NULL,NULL,lpTempBuffer, lstrlen(lpTempBuffer) );
>>optional data to be sent immediately after the request headers.<<
I'm guessing you have to add the intervening new lines yourself.
...or maybe one set or maybe \n\n...
If not, can you get the php page to dump the headers in raw format so you can see exactly what is being sent?
It worked! I found some PHP script code that used the POST command to post to ANOTHER PHP script, and I basically copied their headers and included them. Here is the code:
That CProg interface will be up and running in no time. Thanks for the help.