[Gambas-user] How to bring forward Gambas server pages? (gbw3 related files who to expose in http)

Benoît Minisini gambas at ...1...
Mon Aug 19 20:28:07 CEST 2013


Le 19/08/2013 20:03, PICCORO McKAY Lenz a écrit :
> From: Beno?t Minisini <gambas at ...1...>
>> Subject: Re: [Gambas-user] How to bring forward Gambas server pages?
>>          (gbw3 related files who to expose in http)
>> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
>> Message-ID: <52100D56.6080105 at ...1...>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Don't use Gambas server pages, this is just a bad way of doing things.
>>
>> Gambas can do better: make a normal project with the gb.web component
>> and use it as a CGI script.
>>
> Please how can i put this files in web server? (maybe my question
> could be due i never work with cgi directly)
>
> And i note that i see a http server component in gambas3, this are related to ?
>

First, you must learn how a CGI script work (google is your friend 
there, not only the friend of NSA):

- It is a program run by the web server according to its configuration: 
so read the manual of your web server to know how to run CGI script.

- It receives its arguments from environment variables (the request) and 
returns the reply on its standard output. Hopefully, the Gambas gb.web 
component hides all that behind an ASP-like interface (Request object, 
Response object...) and "Webpage" files, that are Gambas classes 
associated with a HTML page following an ASP-like syntax (see the 
documentation about gb.web on the wiki).

A few points:

- At the moment, there is no request automatic dispatching. I mean: you 
have to choose which page to generate inside your Main function, 
according to the properties of the Request object.

- The Session class allows you to maintain information about a web site 
user between two requests.

- You can check the "use an embedded http server" in the IDE so that you 
can debug your CGI script!

- When I have time (after my holidays in two weeks?) I will write an 
example project of how to make a web site with Gambas. Surely some sort 
of little wiki or blog.

Regards,

-- 
Benoît Minisini




More information about the User mailing list