I'm trying to make a login script in C. I want to know, how I can pass the HTML form data to my back-end c script. I'm new to C (coming from perl)
Just do this?
<form action="test.c"> or <form action="test.a">
How can the script explicitly differ between username and password? Earlier, I just had to do this (in perl):
$username = $cgi->param("username");
How can I do this now in C. I'm trying to avoid using CGI at all.
Edit 1:
It seems I also need to know, how CGI basically works (in short). I'm guessing, the browser is a sort-of compiler for CGI? if not, then is it apache?
Since C is not a interpreted language, how does CGI work with C? In perl, I could simply do:
#!/usr/bin/perl print "Content-type: text/html\n\n"; print "Hello, World.";
How do I do this in C?
Edit2: Ok, I went over to previously answered questions under the cgi tag here on stackoverflow.
This seems to be the most voted one: What is Common Gateway Interface (CGI)?
But it still doesn't clear a few things, which I'm asking here.
Since RFC3875 is only a informational doc, and there is no finalized standard.
Who implements CGI protocol? Who defines its "standard behavior" on servers such as Apache.
How does C files work with CGI in modern environment. Please elaborate using a "Hello World!" as a response to a form submission.