www.digitalmars.com         C & C++   DMDScript  

D - CGI module

reply "Mårten Ask" <majbritt37 hotmail.com> writes:
Hello,

I've written a very basic cgi module. It parses headers, querystrings and
forms as well as getting and settings cookies. It needs lots of more work,
but is quite useful already. Anyway, I've tested it a little and was hoping
that others might test it aswell so I can add useful stuff. I've only used
PHP before and all this strong typing really hurts my brain! :-) So I could
use some help..

Anyway, I'll send the module along and here's a small test program I wrote:

import cgi;

void main()
{
 Request req = new Request();
 Response res = new Response();

 if(req.serverVariable("REQUEST_METHOD") == "POST")
 {
  char[] name = req.formString("name"); // returns formfield value as string
  char[] comment = req.formString("comment");
  res.cookie("name", name, "", "", "", 0);
  res.write("<html>\n<head>\n<title>CGI-test</title>\n</head>\n");
  res.write("<body>\n");
  res.write("Hello <b>"~name~"</b><p>\n");
  res.write("You wrote:\n");
  res.write("<blockquote><b>\""~comment~"\"</b></blockquote>\n");
  res.write("<a href='cgitest.exe'>Back to form</a>");
  res.write("</body></html>");
  res.flush();
 }
 else
 {
  char[] cookie;
  try
  {
   cookie = req.cookie("name");
  }
  catch(CGIError) // cookie wasn't set!
  {
   cookie = "";
  }

  printf(res.getHeaders()~"\n\n");
  printf("<html>\n<head>\n<title>CGI-test</title>\n</head>\n");
  printf("<body>\n");
  printf("<form method='post' action='cgitest.exe'>\n");
  printf("Name: <input type='text' name='name' value='%.*s'><br>\n",
cookie);
  printf("Comment: <input type='text' name='comment'><br>\n");
  printf("<input type='submit' value='Send!'>\n");
  printf("</form></body></html");
 }
}


begin 666 cgi.d
M;6]D=6QE(&-G:3L-" T*:6UP;W)T('-T<F5A;2P <W1R:6YG+"!U<FD[#0H-
M"F5X=&5R;B H0RD 8VAA<BH 9V5T96YV*&-H87(J*3L-" T*#0HO*B!#1TE%
M<G)O<B!T:&EN9VEE("HO#0IC;&%S<R!#1TE%<G)O<B Z($5R<F]R#0I[#0H)
M=&AI<RAC:&%R6UT 97)R;W(I#0H)>PT*"0ES=7!E<BAE<G)O<BD[#0H)?0T*
M?0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AI;G0 :3L :2 \(&1I8W0N;&5N9W1H.R!I*RLI#0H)"7L-" D)"7)E<W5L
M=%MI72 ]('5R:2YD96-O9&4H9&EC=%MI72D[#0H)"7T-" D)#0H)"7)E='5R
M;B!R97-U;'0[#0H)?0T*?0T*=6YI='1E<W0-"GL-" E087)S97( <" ](&YE
M=R!087)S97(H*3L-" EP+G!A<G-E*")N/4TE831R=&5N*T%S:R9G/3,T)FAE
M:CUH96QL;R9H96H]:&5L;&\R(BD[#0H)87-S97)T*' N9V5T4W1R:6YG*")N
M(BD /3T (DWE<G1E;B!!<VLB*3L-" EA<W-E<G0H<"YG971);G0H(F<B*2 ]
M/2 S-"D[#0H)87-S97)T*' N9V5T07)R87DH(FAE:B(I6S!=(#T](")H96QL
M;R(I.PT*"6%S<V5R="AP+F=E=$%R<F%Y*")H96HB*5LQ72 ]/2 B:&5L;&\R
M(BD[#0I]#0H-" T*+RH 1F]R;2!P87)S97(N(')E861S(&9R;VT <W1D:6XN
M('5S92!I="!D:7)E8W1L>2!O<B!V:6$ =&AE(%)E<75E<W0 ;W( 4F5S<&]N
M<V4 8VQA<W-E<R J+PT*8VQA<W, 1F]R;2 Z(%!A<G-E< T*>PT*"71H:7,H
M*0T*"7L-" D):68H*&5N=B B4D5154535%]-151(3T0B*2 ]/2 B4$]35"(I
M("8F("AA=&]I*&5N=B B0T].5$5.5%],14Y'5$ B*2D /B P*2D #0H)"7L-
M" D)"7!A<G-E*'-T9&EN+G1O4W1R:6YG*"DI.PT*"0E]#0H)?0T*?0T*#0H-
M" T*+RH <75E<GES=')I;F< <&%R<V5R+B!U<V4 :70 9&ER96-T;'D ;W( 
M=FEA('1H92!297%U97-T(&]R(%)E<W!O;G-E(&-L87-S97, *B\ #0IC;&%S
M<R!1=65R>7-T<FEN9R Z(%!A<G-E< T*>PT*"71H:7,H*0T*"7L-" D)8VAA
M<EM=('%S(#T 96YV*")1545265]35%))3D<B*3L-" D):68H<7,N;&5N9W1H
M(#X ,"D-" D)>PT*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64I.PT*"0E]#0H)?0T*"0T*"2\J('=R:71E<R!N97< 8V]O:VEE
M('1O(&AE861E<G, *B\-" EV;VED('-E=$-O;VMI92AC:&%R6UT ;F%M92P 
M8VAA<EM=('9A;'5E+"!C:&%R6UT 97AP:7)E<RP 8VAA<EM=('!A=& L(&-H
M87);72!D;VUA:6XL(&)I="!S96-U<F4I( T*"7L-" D)8VAA<EM=(')E<W5L
M=#L-" D)#0H)"6EF*&YA;64N;&5N9W1H(#T](# I( T*"0E[( T*"0D)=&AR
M;W< ;F5W($-'245R<F]R*")#;V]K:65S(&UU<W0 :&%V92!N86UE<R$B*3L 
M#0H)"7T-" D)96QS92 -" D)>R -" D)"7)E<W5L="!^/2 B4V5T+4-O;VMI
M93H (GYN86UE?B(](GYV86QU93L #0H)"7T-" D):68H97AP:7)E<RYL96YG
M=&  /B P*0T*"0E[#0H)"0ER97-U;'0 ?CT (CL 97AP:7)E<STB?F5X<&ER
M97,[#0H)"7T-" D):68H<&%T:"YL96YG=&  /B P*0T*"0E[#0H)"0ER97-U
M;'0 ?CT (CL <&%T:#TB?G!A=& [#0H)"7T-" D):68H9&]M86EN+FQE;F=T
M:" ^(# I#0H)"7L-" D)"7)E<W5L="!^/2 B.R!D;VUA:6X](GYD;VUA:6X[
M#0H)"7T-" D):68H<V5C=7)E*2 -" D)>R -" D)"7)E<W5L="!^/2 B.R!S
M96-U<F4B.R -" D)?0T*"0D)#0H)"0T*"0EC;V]K:65S5&]396YD('X](')E
M<W5L=#L-" E]#0H)#0H)+RH <F5T=7)N<R!A;B!A<W-O8VEA=&EV92!A<G)A
M>2!O9B!S=')I;F=S('=I=&  86QL(&-O;VMI97, 9F]U;F0 *B\-" EC:&%R
M6UU;8VAA<EM=72!G971!;&Q#;V]K:65S*"D-" E[#0H)"6-H87);75MC:&%R
M6UU=(')E<W5L=#L-" D)8VAA<EM=6UT <SL-" D)#0H)"69O<BAI;G0 :2 ]
M(# [(&D /"!F971C:&5D0V]O:VEE<RYL96YG=& [(&DK*RD-" D)>PT*"0D)
M<R ]('-P;&ET*&9E=&-H961#;V]K:65S6VE=+" B/2(I.PT*"0D)<F5S=6QT
M6W-;,%U=(#T <ULQ73L-" D)?0T*"0D-" D)<F5T=7)N(')E<W5L=#L-" E]
M#0H)#0H)#0H)+RH <F5T=7)N('!R;W!E<FQY(&9O<FUA='1E9"!H96%D97)S
M(&9O<B!P<FEN=&EN9R J+PT*"6-H87);72!G971#;V]K:65(96%D97)S*"D-
M" E[#0H)"7)E='5R;B!J;VEN*&-O;VMI97-4;U-E;F0L(")<;B(I.PT*"7T-
M"GT-" T*#0IC;&%S<R!297%U97-T#0I[#0H)1F]R;2!F.PT*"5%U97)Y<W1R
M:6YG('$[#0H)0V]O:VEE(&,[#0H)#0H)=&AI<R I#0H)>PT*"0EF(#T ;F5W
M($9O<FTH*3L-" D)<2 ](&YE=R!1=65R>7-T<FEN9R I.PT*"0EC(#T ;F5W
M($-O;VMI92 I.PT*"7T-" D-" DO*B!R971U<FYS('1H92!E;G9I<F]N;65N
M="!V87)I86)L92 J+PT*"6-H87);72!S97)V97)687)I86)L92AC:&%R6UT 
M;F%M92D-" E[#0H)"7)E='5R;B!E;G8H;F%M92D[#0H)?0T*"0T*"2\J(')E
M='5R;G, =&AE('9A;'5E(&]F(&9O<FUF:65L9"!A<R!A('-T<FEN9R J+PT*
M"6-H87);72!F;W)M4W1R:6YG*&-H87);72!F:65L9$YA;64I#0H)>PT*"0ER
M971U<FX 9BYG9713=')I;F<H9FEE;&1.86UE*3L-" E]#0H)#0H)+RH <F5T
M=7)N<R!A(&9O<FUF:65L9"!V86QU92!A<R!A;B!I;G0 *B\-" EI;G0 9F]R
M;4EN="AC:&%R6UT 9FEE;&1.86UE*0T*"7L-" D)<F5T=7)N(&8N9V5T26YT
M*&9I96QD3F%M92D[#0H)?0T*"0T*"2\J(')E='5R;G, 86QL(&9O<FUF:65L
M9', ;F%M960 )V9I96QD;F%M92< 87, 87)R87D ;V8 <W1R:6YG<R J+PT*
M"6-H87);75M=(&9O<FU!<G)A>2AC:&%R6UT 9FEE;&1.86UE*0T*"7L-" D)
M<F5T=7)N(&8N9V5T07)R87DH9FEE;&1.86UE*3L-" E]#0H)#0H)+RH <F5T
M=7)N<R!Q=65R>7-T<FEN9R!V86QU92!A<R!S=')I;F< *B\-" EC:&%R6UT 
M<75E<GE3=')I;F<H8VAA<EM=(&YA;64I#0H)>PT*"0ER971U<FX <2YG9713
M=')I;F<H;F%M92D[#0H)?0T*"0T*"2\J(')E='5R;G, <75E<GES=')I;F< 
M=F%L=64 87, :6YT("HO#0H):6YT('%U97)Y26YT*&-H87);72!N86UE*0T*
M"7L-" D)<F5T=7)N('$N9V5T26YT*&YA;64I.PT*"7T-" D-" DO*B!R971U
M<FYS(&%L;"!Q=65R>7-T<FEN9R!V86QU97, =VET:"!T:&4 ;F%M92 G;F%M
M92< 87, 87)R87D ;V8 <W1R:6YG<R J+PT*"6-H87);75M=('%U97)Y07)R
M87DH8VAA<EM=(&YA;64I#0H)>PT*"0ER971U<FX <2YG971!<G)A>2AN86UE
M*3L-" E]#0H)#0H)+RH <F5T=7)N<R!V86QU92!O9B!C;V]K:64 )VYA;64G
M("HO#0H)8VAA<EM=(&-O;VMI92AC:&%R6UT ;F%M92D-" E[#0H)"7)E='5R
M;B!C+F=E=$-O;VMI92AN86UE*3L-" E]#0H)#0H)+RH <F5T=7)N<R!A;&P 
M8V]O:VEE<R!F;W5N9"!A<R!A<W-O8VEA=&EV92!A<G)A>2!O9B!S=')I;F=S
M("HO#0H)8VAA<EM=6V-H87);75T 86QL0V]O:VEE<R I#0H)>PT*"0ER971U
M<FX 8RYG971!;&Q#;V]K:65S*"D[#0H)?0T*?0T*#0IC;&%S<R!297-P;VYS
M90T*>PT*"4-O;VMI92!C.PT*"6-H87);75M=(&AE861E<G,[#0H)8VAA<EM=
M(&)U9F9E<CL-" D-" ET:&ES*"D-" E[#0H)"6, /2!N97< 0V]O:VEE*"D[
M#0H)?0T*"0T*"2\J('-E=', ;F5W(&-O;VMI92X ;VYL>2 G;F%M92< :7, 
M;F5E9&5D+B J+PT*"79O:60 8V]O:VEE*&-H87);72!N86UE+"!C:&%R6UT 
M=F%L=64L(&-H87);72!E>'!I<F5S+"!C:&%R6UT <&%T:"P 8VAA<EM=(&1O
M;6%I;BP 8FET('-E8W5R92D-" E[#0H)"6,N<V5T0V]O:VEE*&YA;64L('9A
M;'5E+"!E>'!I<F5S+"!P871H+"!D;VUA:6XL('-E8W5R92D[#0H)?0T*"0T*
M"2\J('=R:71E<R G<W1R)R!T;R!C=7)R96YT(&)U9F9E<B J+PT*"79O:60 
M=W)I=&4H8VAA<EM=('-T<BD-" E[#0H)"6)U9F9E<B!^/2!S='([#0H)?0T*
M"0T*"2\J('=R:71E<R!A(&YE=R!H96%D97( *B\-" EV;VED(&AE861E<BAC
M:&%R6UT ;F%M92P 8VAA<EM=('9A;'5E*0T*"7L-" D):&5A9&5R<R!^/2!N
M86UE?B(Z(")^=F%L=64[#0H)?0T*"0T*"2\J(')E9&ER96-T<R!T:&4 8G)O
M=W-E<B!T;R G;&]C871I;VXG("HO#0H)=F]I9"!R961I<F5C="AC:&%R6UT 
M;&]C871I;VXI#0H)>PT*"0EH96%D97)S('X]("),;V-A=&EO;CH (GYL;V-A
M=&EO;CL-" E]#0H)#0H)+RH <F5T=7)N<R!P<F]P97)L>2!F;W)M871T960 
M:&5A9&5R<R!F;W( <')I;G1I;F<N(&EF#0H)("H 0V]N=&5N="UT>7!E(&ES
M;B=T(&EN('1H97)E+"!T97AT+VAT;6P :7, 87-S=6UE9"X-" D *B!D;VXG
M="!F;W)G970 =&\ 861D('1W;R!L:6YE8G)E86MS(&)E9F]R92!A;GD 8V]N
M=&5N="$-" D *B\-" EC:&%R6UT 9V5T2&5A9&5R<R I#0H)>PT*"0EB:70 
M86QL4V5T(#T ,#L-" D)9F]R*&EN="!I.R!I(#P :&5A9&5R<RYL96YG=& [
M(&DK*RD-" D)>PT*"0D):68H:&5A9&5R<UMI75LP+BXQ,ET /3T (D-O;G1E
M;G0M='EP92(I#0H)"0E[#0H)"0D)86QL4V5T(#T ,3L-" D)"0EB<F5A:SL-
M" D)"7T-" D)?0T*"0EI9B A86QL4V5T*0T*"0E[#0H)"0EH96%D97)S('X]
M(")#;VYT96YT+71Y<&4Z('1E>'0O:'1M;"([#0H)"7T-" D)#0H)"6AE861E
M<G, ?CT 8RYG971#;V]K:65(96%D97)S*"D[#0H)"0T*"0ER971U<FX <W1R
M:6YG+FIO:6XH:&5A9&5R<RP (EQN(BD[#0H)?0T*"0T*"2\J(')E='5R;G, 
M=&AE(&-U<G)E;G0 8G5F9F5R("HO#0H)8VAA<EM=(&=E=$)U9F9E<B I#0H)
M>PT*"0ER971U<FX 8G5F9F5R.PT*"7T-" D-" DO*B!P<FEN=', =&AE(&AE
M861E<G, 86YD(&)U9F9E<B J+PT*"79O:60 9FQU<V H*0T*"7L-" D)8VAA
M<EM=(')E<W5L=#L-" D)<F5S=6QT(#T 9V5T2&5A9&5R<R I?B)<;EQN(CL-
M" D)<F5S=6QT('X](&)U9F9E<CL-" D)<')I;G1F*')E<W5L="D[#0H)?0T*
#?0T*
`
end
Jul 27 2003
parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"Mårten Ask" <majbritt37 hotmail.com> wrote in message
news:bg0tqe$2mhm$1 digitaldaemon.com...
| Hello,
|
| I've written a very basic cgi module. It parses headers, querystrings and
| forms as well as getting and settings cookies. It needs lots of more work,
| but is quite useful already. Anyway, I've tested it a little and was
hoping
| that others might test it aswell so I can add useful stuff. I've only used
| PHP before and all this strong typing really hurts my brain! :-) So I
could
| use some help..
|
| Anyway, I'll send the module along and here's a small test program I
wrote:
| ...

what do I have to do to use cgi?

—————————————————————————
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 2003-07-24
Jul 27 2003
parent reply "Charles Sanders" <sanders-consulting comcast.net> writes:
Yes I'd like to know also, is their instructions to setup apache with it
somewhere?

Charles

"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:bg2477$tb5$1 digitaldaemon.com...
 "Mårten Ask" <majbritt37 hotmail.com> wrote in message
 news:bg0tqe$2mhm$1 digitaldaemon.com...
 | Hello,
 |
 | I've written a very basic cgi module. It parses headers, querystrings
and
 | forms as well as getting and settings cookies. It needs lots of more
work,
 | but is quite useful already. Anyway, I've tested it a little and was
 hoping
 | that others might test it aswell so I can add useful stuff. I've only
used
 | PHP before and all this strong typing really hurts my brain! :-) So I
 could
 | use some help..
 |
 | Anyway, I'll send the module along and here's a small test program I
 wrote:
 | ...

 what do I have to do to use cgi?

 -------------------------
 Carlos Santander


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.504 / Virus Database: 302 - Release Date: 2003-07-24
Jul 28 2003
parent reply "Mårten Ask" <majbritt37 hotmail.com> writes:
With apache you just put the .exe in the cgi-bin directory. Then reach it at
http://localhost/cgi-bin/filename.exe


"Charles Sanders" <sanders-consulting comcast.net> skrev i meddelandet
news:bg3dmn$28uh$1 digitaldaemon.com...
 Yes I'd like to know also, is their instructions to setup apache with it
 somewhere?

 Charles

 "Carlos Santander B." <carlos8294 msn.com> wrote in message
 news:bg2477$tb5$1 digitaldaemon.com...
 "Mårten Ask" <majbritt37 hotmail.com> wrote in message
 news:bg0tqe$2mhm$1 digitaldaemon.com...
 | Hello,
 |
 | I've written a very basic cgi module. It parses headers, querystrings
and
 | forms as well as getting and settings cookies. It needs lots of more
work,
 | but is quite useful already. Anyway, I've tested it a little and was
 hoping
 | that others might test it aswell so I can add useful stuff. I've only
used
 | PHP before and all this strong typing really hurts my brain! :-) So I
 could
 | use some help..
 |
 | Anyway, I'll send the module along and here's a small test program I
 wrote:
 | ...

 what do I have to do to use cgi?

 -------------------------
 Carlos Santander


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.504 / Virus Database: 302 - Release Date: 2003-07-24
Jul 28 2003
parent "Carlos Santander B." <carlos8294 msn.com> writes:
"Mårten Ask" <majbritt37 hotmail.com> wrote in message
news:bg3n4v$2ik1$1 digitaldaemon.com...
| With apache you just put the .exe in the cgi-bin directory. Then reach it
at
| http://localhost/cgi-bin/filename.exe
|

And if I'm trying to access it from a html page? I mean, how do I put it in
a <a href=...>?

—————————————————————————
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 2003-07-24
Jul 30 2003