CGI C and HTML

From: Sergio (emsrome_at_libero.it)
Date: 12/27/03


Date: 27 Dec 2003 00:59:08 -0800

Merry Christmas to You all.
My system: WIN XP, DEV CPP 4.x(C compiler).

Consider this HTML code.

<HTML>
<BODY>

<FORM NAME="MyForm" ACTION="c:\PATH\MyProgram.exe" METHOD="GET"
ENCTYPE="application/x-www-form-urlencoded">

<INPUT TYPE="TEXT" NAME="MyString">
<INPUT TYPE="SUBMIT" NAME="Iaccept" VALUE="OK">
</FORM>
</BODY>
</HTML>
This code should have to produce a string("MyForm") and on SUBMIT,
this should be sent to MyProgram.exe to be processed.

Consider this C code.

#include <stdio.h>

void main(int argc, char *argv[]){

/* Your code */
char *MyForm;
FILE *filePtr;
filePtr=fopen("c:\\PATH\\MyText.txt","w");
fprintf(filePtr,"%s",MyForm);
return NULL;

}

The above C code should have to capture the HTML contents and to put
it into MyText.txt.
Does't interest to tokenize and to unescape the string.
I need to understand the mechanism of CGI C(pure ANSI C, better
unstructured).
Particularly, how could I capture by a C program a string comes from
another program.
For example, on command line by argv[], I can pass a string to the
program; unfortunately this procedure doesn't run between two
programs. Better I'm not able to exchange a string between programs,
without using any disk, only from RAM.

Greetings from Italy

Sergio



Relevant Pages

  • Re: getAttribute question
    ... oddity with IE that getAttributereturns an empty string if the ... HTML specification, ... appropriate places in the HTML 4 and DOM HTML specifications. ...
    (comp.lang.javascript)
  • Re: [PHP] generating an html intro text ...
    ... You would have to search out and pull in all closing tags. ... grab 256 characters -- The string. ... html markup should not go towards the string length count, ...
    (php.general)
  • [perl-python] 20050127 traverse a dir
    ... suppose you want to walk into a directory, say, to apply a string ... replacement to all html files. ... So, when ever myfun is called, we need to loop thru the ... # with a recursive "filter" ...
    (comp.lang.perl.misc)
  • [perl-python] 20050127 traverse a dir
    ... suppose you want to walk into a directory, say, to apply a string ... replacement to all html files. ... So, when ever myfun is called, we need to loop thru the ... # with a recursive "filter" ...
    (comp.lang.python)
  • Re: is there a way to take an html string and render it as a web browser would, from the command lin
    ... is there a way to take an html string and render it as a web ... browser would, from the command line? ... particular, image tags should print out as images, not image tags. ...
    (comp.lang.php)