You always recieve a content length as argv[1].
The query information (the form results) is sent to the script in stdin as opposed to as argv[1] or argv[2]. The content length (argv[1]) is how long it is. Once you have read and decoded that many bytes, you should send httpd output on stdout just as you normally would.
For an example, see the post-query source. This comes with the NCSA httpd
distribution, in the htbin-post/src
directory.
httpd@ncsa.uiuc.edu