can somebody give a simple CGI primer using C++ or C for example? Let`s say a mail form similar to php/form pattern but using CGI with CPP/C? I have no clue how it is done, and I am interested.
Asked
Active
Viewed 158 times
-1
-
3First link in google:"cgi c example". http://www.cs.tut.fi/~jkorpela/forms/cgic.html#ex – Robᵩ Feb 01 '12 at 16:53
-
1I'm all for freedom and all, but *why* would you do this? C and C++ aren't particularly well-suited for this task. Unless you're mainly interested in the CGI mechanism itself, I suppose. – FatalError Feb 01 '12 at 16:53
-
Well... to be honest, PHP is not my language of choice... it has too many stuff there... it does a lot of things for yourself... Yes, you may think that iss stupid but I prefer C/C++ if there is a way to replace PHP work with these... – Ilian Zapryanov Feb 01 '12 at 16:58
-
@rob thanks this is a nice guide... kind of noob like me :) Will try it right away. – Ilian Zapryanov Feb 01 '12 at 16:59
-
1If you don't want to deal with the CGI protocol "by hand", see this post: http://stackoverflow.com/questions/316200/which-c-library-for-cgi-programming You might specifically like http://www.gnu.org/software/cgicc/ and http://www.boutell.com/cgic/ – Robᵩ Feb 01 '12 at 17:23
1 Answers
2
I prefer C/C++ if there is a way to replace PHP work with these
In that case, you will find G-WAN C and C++ (compiled) scripts very helpful!
Instead of having to stop the server to recompile a C module (like with Nginx or Apache), G-WAN lets you "edit & play" your C/C++ source code in real-time.

Frolic
- 36
- 1
-
Note that the OP isn't asking about modules, but about CGI. To be clear, you don't have to restart the serve when replacing a CGI program. – Robᵩ Feb 01 '12 at 17:21