Re: [fpc-pascal] CGI application

2010-05-20 Thread Felipe Monteiro de Carvalho
Using powtils you can write something like the example bellow, which I consider cleaner and easier to maintain: From: http://code.google.com/p/powtils/source/browse/dev#dev/examples/raw-template program project1; {$IFDEF FPC}{$mode objfpc}{$H+}{$ENDIF} {$APPTYPE CONSOLE} uses pwinit, pwmain;

Re: [fpc-pascal] CGI application

2010-05-20 Thread Jorge Aldo G. de F. Junior
Try using powtils : http://z505.com/powtils/idx.shtml ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] CGI application

2010-05-19 Thread Vannus
Thats me up & running now - thanks for your help guys, I'll certainly poke around those CGI vars. On 19 May 2010 14:19, Carsten Bager wrote: > > How do i get command line vars? i tried GetENV() but it didn't understand > GetEnv() (which unit is > > it in?) > > > Here is a small cgi program. Comm

Re: [fpc-pascal] CGI application

2010-05-19 Thread Carsten Bager
> How do i get command line vars? i tried GetENV() but it didn't understand > GetEnv() (which unit is > it in?) Here is a small cgi program. Comments are in Danish but I hope you can get the meaning. Carsten {Program version 1.00} program listdir2html; {LONGSTRINGS OFF} {$INFO +-

Re: [fpc-pascal] CGI application

2010-05-19 Thread Graeme Geldenhuys
Vannus het geskryf: > > How do i get command line vars? i tried GetENV() but it didn't understand > GetEnv() (which unit is it in?) ParamCount() and ParamStr() is part of the System unit, so is always available. GetEnvironmentVariable() is in the SysUtils unit. Note that CGI apps use a lot of

Re: [fpc-pascal] CGI application

2010-05-19 Thread Vannus
eh - im pretty sure im using ARequest and not AResponse (im on differnt pc just now, can't check) - but i'll definetly double check when i get back! How do i get command line vars? i tried GetENV() but it didn't understand GetEnv() (which unit is it in?) Cheers. On 19 May 2010 13:55, Graeme Geld

Re: [fpc-pascal] CGI application

2010-05-19 Thread Graeme Geldenhuys
Vannus het geskryf: > Can someone point me to how I can make a CGI app that outputs the fields in > the query? Think of CGI apps as simple Console applications (that's pretty much what they are). Everything after the ? is simply passed in as a parameter to your program. In it's simplest form you c

Re: [fpc-pascal] CGI application

2010-05-19 Thread Michael Van Canneyt
On Wed, 19 May 2010, Vannus wrote: This may not be the right place to ask, but I'm really stumped and would much prefer FPC over PHP. Can someone point me to how I can make a CGI app that outputs the fields in the query? ie. my.cgi?q=hello and my.cgi then outputs whatever q is? I'm using