How to retrieve form “POST” data via cgi-bin program written in C

后端 未结 3 745
小蘑菇
小蘑菇 2020-12-03 15:02

I am trying to retrieve POST data from html form using program written in C.

At the moment I am using:

char *formdata = getenv(\"QUERY_STRING\");
if(         


        
3条回答
  •  眼角桃花
    2020-12-03 15:46

    POST data is appended to the request header, after a double newline. In a CGI-BIN environment, you read it from STDIN.

    Be warned that the server IS NOT REQUIRED to send you an EOF character (or some termination indicator) at the end of the POST data. Never read more than CONTENT_LENGTH bytes.

提交回复
热议问题