Re: CGI C and HTML
From: Sean Kenwrick (skenwrick_at_hotmail.com)
Date: 12/27/03
- Next message: Richard Heathfield: "Re: Using bitshift in assigning a number to a variable?"
- Previous message: Sean Kenwrick: "Re: Using bitshift in assigning a number to a variable?"
- In reply to: Sergio: "CGI C and HTML"
- Next in thread: Keith Thompson: "Re: CGI C and HTML"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 27 Dec 2003 10:12:23 +0000 (UTC)
"Sergio" <emsrome@libero.it> wrote in message
news:6daea39c.0312270059.526c7f16@posting.google.com...
> 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
To pass data between two programs you can read and write to stdin and
stdout. So if you have
prog1, prog2 and prog3 that all read from stdin and write to stdout then on
the command line you can
do something like:
prog1 | prog2 | prog3
Sean
- Next message: Richard Heathfield: "Re: Using bitshift in assigning a number to a variable?"
- Previous message: Sean Kenwrick: "Re: Using bitshift in assigning a number to a variable?"
- In reply to: Sergio: "CGI C and HTML"
- Next in thread: Keith Thompson: "Re: CGI C and HTML"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|