Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

CGI programming in C

eikedehlingeikedehling Member Posts: 123
Does anyone have experience in programming the CGI interface in C ?
I have a document telling me that using the POST method for accessing dosuments, all input should be on stdin and output should go to stdout, but since that is pretty much *it* for that document, i would be interested in any experience/info on how to do so ... Maybe it would be easier to write a 'webserver' of my own that directly processes stuff ?? mainly i want to do stuff like simple database services via HTTP. so for e.g accessing a few data, dependant on host, etc. Normally (e.g. in PHP) you don't get to know the client requesting things :-)

Thanx, Eike.

SUSE LINUX 7.3 PRO - The world starts behind windows

Comments

  • DariusDarius Member Posts: 1,666
    : Does anyone have experience in programming the CGI interface in C ?
    : I have a document telling me that using the POST method for accessing dosuments, all input should be on stdin and output should go to stdout, but since that is pretty much *it* for that document

    That and environment variables are pretty much *it* for CGI. There are only a few details you need to know mainly for input what the format is, which you should have seen, but it's relatively straightforward and for output just remember to send the content type (how does the client know that you are sending HTML or plain text or a PNG image?) Anyways, www.cgi101.com has the basic information and examples of using CGI. It uses PERL for implementing it, but you don't need to worry about the language all you need is the format you'll get and receive the information.

    : i would be interested in any experience/info on how to do so ... Maybe it would be easier to write a 'webserver' of my own that directly processes stuff ??

    A simple webserver isn't hard to code at all, but I doubt you want a simple webserver.

    : mainly i want to do stuff like simple database services via HTTP. so for e.g accessing a few data, dependant on host, etc. Normally (e.g. in PHP) you don't get to know the client requesting things :-)
    :

    As PHP is just another CGI, you aren't going to get access to anything in a C CGI that you don't have access to in a PHP CGI, but plenty of people code DB stuff with PHP. PHP/MySQL has become almost a single word. Also, you do get a variety of information about the client. So either I'm not understanding what you are going for, or you need to read those CGI documents closer (or read better ones).

    "We can't do nothing and think someone else will make it right."
    -Kyoto Now, Bad Religion

  • Andre YoungAndre Young USAMember Posts: 0

    __ || http://forcoder.org || free ebooks and video tutorials about [ Visual Basic .NET, Delphi, Java, PL/SQL, Ruby, Assembly, Python, PHP, C, Go, MATLAB, Scratch, C#, Visual Basic, Objective-C, JavaScript, Perl, Swift, C++, R Logo, Fortran, Scheme, SAS, Kotlin, Clojure, Dart, ABAP, Apex, VBScript, Erlang, Rust, Scala, Bash, Crystal, Transact-SQL, D, Julia, Awk, F#, Alice, Ada, ML, Lisp, Lua, COBOL, LabVIEW, FoxPro, Hack, Prolog ] ___

Sign In or Register to comment.