Linux.com

writing cgi using C++

Link to this post 23 May 11

Hi

I'm writing a C++ program to run it as cgi. I need to receive input, and as I've found out looking up the net, the most fundamental way is to use getenv() from cstdlib.h.

I wanna know if there's any other interface to receiving environment variables, that is made for C++, I mean I look for equivalent of cstdlib.h in C++, IF EXISTS AT ALL.

Thanks. :)

Link to this post 23 May 11

and of course, how to receive POST data?

Link to this post 24 May 11

ActiveX wrote:

and of course, how to receive POST data?

The system call interface to any CGI program/script is the same no matter the language the CGI was written in. This is documented in the HTML standards. You just need for your C/C++ program to process the passed arguments appropriately.

Link to this post 24 May 11

woboyle wrote:



The system call interface to any CGI program/script is the same no matter the language the CGI was written in. This is documented in the HTML standards. You just need for your C/C++ program to process the passed arguments appropriately.

I do not know much about this matter (if anything at all).

Do you have any link where I could get introduced to all this CGI world?

Thanks woboyle!

Regards

Link to this post 24 May 11

Rubberman, what do you mean by that?
Receiving GET data is as simple as using getenv("QUERY_STRING") , kid's stuff, but I need to handle much bigger data and therefore I have to use ... POST! you know.

Please tell me clearly what should I do to receive post data?

And also, I asked if there's any library that can be used instead of <stdlib.h> and is not based on <stdlib.h>.

Link to this post 24 May 11

I believe that the POST data is passed to the stdin of the CGI program.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board