Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-05

CGI using weblaz

12 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joost van der Sluis
to Vannus
Vannus wrote 9 lines
Has anybody got query's to work with weblaz TCustomCGIApplication? ie. my.cgi?q=hello and my.cgi then outputs whatever q is? the AResponse.Fields don't get filled with the query and AResponse.URL doesn't contain the URL for me to parse myself :(

Try AResponse.QueryFields.

You can also have a look here:
http://services.cnoc.nl/lazarus/index/fclweb

The examples also show what you want.

Joost.

Reply by email

ABorka
to Vannus: Has anybody got query's to work with weblaz TCustomCGIApplication? ie. my.cgi?q=hello and…

You can find demo programs for fpweb under your Lazarus directory in

/components/fpweb/demo/

the fptemplate ones are particularly useful for building websites with FPC/Lazarus

AB

Vannus wrote 17 lines
Has anybody got query's to work with weblaz TCustomCGIApplication? ie. my.cgi?q=hello and my.cgi then outputs whatever q is? the AResponse.Fields don't get filled with the query and AResponse.URL doesn't contain the URL for me to parse myself :( -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Vannus
to Joost van der Sluis: Try AResponse.QueryFields. You can also have a look here:…

ah-ha! there they are - thanks!

Joost van der Sluis wrote 27 lines
On Wed, 2010-05-19 at 13:45 +0100, Vannus wrote: > Has anybody got query's to work with weblaz TCustomCGIApplication? > > ie. > my.cgi?q=hello > > and my.cgi then outputs whatever q is? > > the AResponse.Fields don't get filled with the query and AResponse.URL > doesn't contain the URL for me to parse myself :( Try AResponse.QueryFields. You can also have a look here: http://services.cnoc.nl/lazarus/index/fclweb The examples also show what you want. Joost. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100519/0d8f8b8b/attachment.html>

Reply by email

Leonardo M. Ramé
to Vannus

Hi, I'm trying to create a non-default action that must be executed when the url is /cgi-bin/myprogram?action=ShowListing. When I change the Content-property to "ShowListing" it automatically adds an #10 character at the end, this can be easily see in the lfm file as follows (also note that Contents.strings is added by Lazarus -not by me-):

object FPWebModule1: TFPWebModule1
OldCreateOrder = False
Actions = <
item
Name = 'ShowListing'
Default = False
Content = 'ShowListing'#10
Contents.Strings = (
'ShowListing'
)
OnRequest = TFPWebActions1Request

    end
    item
      Name = 'DefaultAction'
      Default = True
      OnRequest = TFPWebActions0Request
    end>
  DefActionWhenUnknown = False
  CreateSession = False
  Height = 142
  HorizontalOffset = 2045
  VerticalOffset = 753
  Width = 161

end

Leonardo M. Ram? Griensu S.A. - Medical IT C?rdoba Tel.: 0351-4247979

Reply by email

Joost van der Sluis
to Leonardo M. Ramé
Leonardo M. Ram? wrote 5 lines
Hi, I'm trying to create a non-default action that must be executed when the url is /cgi-bin/myprogram?action=ShowListing. When I change the Content-property to "ShowListing" it automatically adds an #10 character at the end, this can be easily see in the lfm file as follows (also note that Contents.strings is added by Lazarus -not by me-):

Problem is that the 'content' property is in fact Contents.Text. So this information is stored twice in the lfm. And an end-of-line character is added.

I don't know why both properties are there. Michael, do you know this?

Joost

Reply by email

Michael Van Canneyt
to Joost van der Sluis
Joost van der Sluis wrote 12 lines
On Wed, 2010-05-19 at 17:35 -0300, Leonardo M. Ram? wrote: > Hi, I'm trying to create a non-default action that must be executed when > the url is /cgi-bin/myprogram?action=ShowListing. When I change the > Content-property to "ShowListing" it automatically adds an #10 character > at the end, this can be easily see in the lfm file as follows (also note > that Contents.strings is added by Lazarus -not by me-): Problem is that the 'content' property is in fact Contents.Text. So this information is stored twice in the lfm. And an end-of-line character is added. I don't know why both properties are there. Michael, do you know this?

For ease of use; But only one should be stored. Maybe one should be made public ?

Michael.

Reply by email

Joost van der Sluis
to Michael Van Canneyt
Michael Van Canneyt wrote 18 lines
On Thu, 20 May 2010, Joost van der Sluis wrote: > On Wed, 2010-05-19 at 17:35 -0300, Leonardo M. Ram? wrote: >> Hi, I'm trying to create a non-default action that must be executed when >> the url is /cgi-bin/myprogram?action=ShowListing. When I change the >> Content-property to "ShowListing" it automatically adds an #10 character >> at the end, this can be easily see in the lfm file as follows (also note >> that Contents.strings is added by Lazarus -not by me-): > > Problem is that the 'content' property is in fact Contents.Text. So this > information is stored twice in the lfm. And an end-of-line character is > added. > > I don't know why both properties are there. Michael, do you know this? For ease of use; But only one should be stored. Maybe one should be made public ?

That way you can't use it in the Lazarus object inspector. Defeating the 'ease of use' ?

Joost.

Reply by email

Michael Van Canneyt
to Joost van der Sluis
Joost van der Sluis wrote 22 lines
On Thu, 2010-05-20 at 11:48 +0200, Michael Van Canneyt wrote: > > On Thu, 20 May 2010, Joost van der Sluis wrote: > > > On Wed, 2010-05-19 at 17:35 -0300, Leonardo M. Ram? wrote: > >> Hi, I'm trying to create a non-default action that must be executed when > >> the url is /cgi-bin/myprogram?action=ShowListing. When I change the > >> Content-property to "ShowListing" it automatically adds an #10 character > >> at the end, this can be easily see in the lfm file as follows (also note > >> that Contents.strings is added by Lazarus -not by me-): > > > > Problem is that the 'content' property is in fact Contents.Text. So this > > information is stored twice in the lfm. And an end-of-line character is > > added. > > > > I don't know why both properties are there. Michael, do you know this? > > For ease of use; But only one should be stored. Maybe one should be made > public ? That way you can't use it in the Lazarus object inspector. Defeating the 'ease of use' ?

I really have no preference here; At the very least we should solve the discrepancy between the 2 methods. This can be as simple as adding a 'Stored: False' to Contents property and reversing the process: Contents stores it's content in 'Content' with each 'OnChange'. And then only 'Content' will be written.

Michael.

Reply by email

Leonardo M. Ramé
to Michael Van Canneyt

El jue, 20-05-2010 a las 12:22 +0200, Michael Van Canneyt escribi?:

Show quoted text 14 lines
On Thu, 20 May 2010, Joost van der Sluis wrote: > On Thu, 2010-05-20 at 11:48 +0200, Michael Van Canneyt wrote: >> >> On Thu, 20 May 2010, Joost van der Sluis wrote: >> >> > On Wed, 2010-05-19 at 17:35 -0300, Leonardo M. Ram? wrote: >> >> Hi, I'm trying to create a non-default action that must be executed when >> >> the url is /cgi-bin/myprogram?action=ShowListing. When I change the >> >> Content-property to "ShowListing" it automatically adds an #10 character >> >> at the end, this can be easily see in the lfm file as follows (also note >> >> that Contents.strings is added by Lazarus -not by me-): >> >

Well, I don't care about the duplicated Content and Contents.Text properties, the "bug" is that my non-default action is not executed, maybe the param "?action=ShowListing" is not evaluated because of the #10?

Leonardo M. Ram? Griensu S.A. - Medical IT C?rdoba Tel.: 0351-4247979

Reply by email

Joost van der Sluis
to Leonardo M. Ramé
Leonardo M. Ram? wrote 20 lines
El jue, 20-05-2010 a las 12:22 +0200, Michael Van Canneyt escribi?: > > On Thu, 20 May 2010, Joost van der Sluis wrote: > > > On Thu, 2010-05-20 at 11:48 +0200, Michael Van Canneyt wrote: > >> > >> On Thu, 20 May 2010, Joost van der Sluis wrote: > >> > >> > On Wed, 2010-05-19 at 17:35 -0300, Leonardo M. Ram? wrote: > >> >> Hi, I'm trying to create a non-default action that must be executed when > >> >> the url is /cgi-bin/myprogram?action=ShowListing. When I change the > >> >> Content-property to "ShowListing" it automatically adds an #10 character > >> >> at the end, this can be easily see in the lfm file as follows (also note > >> >> that Contents.strings is added by Lazarus -not by me-): > >> > Well, I don't care about the duplicated Content and Contents.Text properties, the "bug" is that my non-default action is not executed, maybe the param "?action=ShowListing" is not evaluated because of the #10?
Did you set WebModule.Actionvar:='action'? Else try
cgi-web/program/ShowListing

Joost.

Reply by email

Leonardo M. Ramé
to Joost van der Sluis

El jue, 20-05-2010 a las 14:27 +0200, Joost van der Sluis escribi?:

Show quoted text 27 lines
On Thu, 2010-05-20 at 08:44 -0300, Leonardo M. Ram? wrote: > El jue, 20-05-2010 a las 12:22 +0200, Michael Van Canneyt escribi?: > > > > On Thu, 20 May 2010, Joost van der Sluis wrote: > > > > > On Thu, 2010-05-20 at 11:48 +0200, Michael Van Canneyt wrote: > > >> > > >> On Thu, 20 May 2010, Joost van der Sluis wrote: > > >> > > >> > On Wed, 2010-05-19 at 17:35 -0300, Leonardo M. Ram? wrote: > > >> >> Hi, I'm trying to create a non-default action that must be executed when > > >> >> the url is /cgi-bin/myprogram?action=ShowListing. When I change the > > >> >> Content-property to "ShowListing" it automatically adds an #10 character > > >> >> at the end, this can be easily see in the lfm file as follows (also note > > >> >> that Contents.strings is added by Lazarus -not by me-): > > >> > > > Well, I don't care about the duplicated Content and Contents.Text > properties, the "bug" is that my non-default action is not executed, > maybe the param "?action=ShowListing" is not evaluated because of the > #10? Did you set WebModule.Actionvar:='action'? Else try cgi-web/program/ShowListing Joost.

Hey!, thanks, that worked!.

Leonardo M. Ram? Griensu S.A. - Medical IT C?rdoba Tel.: 0351-4247979

Reply by email