From: Erwann ABALEA Newsgroups: comp.os.msdos.djgpp Subject: Re: Build CGI programs with DJGPP Date: Fri, 6 Nov 1998 13:30:38 +0100 Organization: Conservatoire National des Arts et Metiers Lines: 55 Message-ID: References: NNTP-Posting-Host: fermi.cnam.fr Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Wed, 4 Nov 1998 Fabiano_Zara AT www DOT datasys DOT it wrote: > It's possible to wite CGI programs with djgpp?. I founded problems in > execute it like this: > Very easy... But your HTTPD must support DOS based CGI... Not all of them support DOS programs. > I use OMNI HTTPD server, WIN95 as OS. I use Apache 1.3.1, and it works perfectly. > Can you give me a hint, or can you show an exemple? > Thank you You can start writing a printenv-equiv program. Just dump the env. vars (either using getenv() or the (int argc, char **argv, char **env) parameters of the main() function. Don't forget to send the result in the good format: header, blank line, and them message... Example: Content-Type: text/html; charset=iso-8859-1 Accept-Ranges: bytes Zen...</html> </head> <body> whatever you want... </body> </html> Under Apache, the query_string is placed in the environment var QUERY_STRING. If you need to handle POST requests, the environment var CONTENT_LENGTH should contain the total bytes the browser has sent, and you should read that number of bytes from stdin. The parsing of the data read depends of the encoding method (x-www-urlencoded or ... (I don't remember, something like multipart MIME)). Erwann. -- Erwann ABALEA Certplus SA System and Development Engineer eabalea AT certplus DOT com (work) abalea_e AT cnam DOT fr (school)