Unfortunately, I don't know of a tutorial, and all my down and dirty CGI programming experience was with c-language compiled program.
Given the form:
<html><body>
<form method=get action=foo.php>
<input type=text name=texting>
<input type=text name=texttoo>
<input type=submit>
</form>
</body></html>
The actual URL you go to is
The server must strip off everything after the question mark and put that data, as is, into the environment variable QUERY_STRING then invokes the script. In the current case, the variable QUERY_STRING contains "texting=a&texttoo=b". The CGI then parses it from there.
When accepting POST action form data
<html><body>
<form method=post action=foo.php>
<input type=text name=texting>
<input type=text name=texttoo>
<input type=submit>
</form>
</body></html>
When you hit the submit button, the browser sends the data back in the HTTP stream it sends to the server. The data sent from the server will look something like:
POST /foo.php HTTP/1.0
Content-type: application/x-
Content-length: 24
< a blank line >
texting=a
&texttoo=b
The server then has to make all the data after that blank line available to the CGI via STDIN for it to parse. I don't know if the "Content-length:" header includes [CR][LF] pairs in its count or not. I also don't know whether the data comes one line to a field or not.
What you want to do is to create an HTML page with a POST method form that sends data to your server. You should then be able to view all data and HTTP headers sent in the stream by the browser.