Forum

Where can I get the post data

Monk
15 March 2007, 17:10
Hello,

I use hiawatha webserver whith PHP. My web page is very simple, just a submit form(in POST method). Now I need catch the client's submit data in the webserver (not only in the PHP script).
Could you tell me in which function I can get them?
I use Hiawatha version 5.7.

Monk
Hugo Leisink
15 March 2007, 18:23
A CGI program can read the POST data from STDIN. If you don't understand this, please tell me what kind of CGI program or programming language you are using?
Monk
16 March 2007, 04:17
I get it, thanks.
I use PHP4 and C language, but I know little about unix.
Now I think I need use my own CGI process to replace the PHP CGI to catch the POST data(?).
Do you know any sample for me or a very simple CGI program?
Hugo Leisink
16 March 2007, 10:30
What you want is CGIC: http://www.boutell.com/cgic/
You can also Google for: cgi c example [www.google.com]

Important: HTTP headers should end with \r\n, not \n (this is done very often). So, instead of writing code like:

printf("Content-Type: text/html\n");


you should use:

printf("Content-Type: text/html\r\n");


And to end a HTTP header, you must use \r\n\r\n and NOT \n\n. If you have no idea what I'm talking about, don't worry. Just visit the CGIC website and start reading. Very soon you'll understand what I mean.
Monk
19 March 2007, 07:40
Thank you, that is very helpful.
This topic has been closed.