[Gambas-user] How to load a new page on gb.web by code

Mayost Sharon sharon at 455.co.il
Thu Sep 21 07:56:09 CEST 2023


---------- Original Message -----------
From: T Lee Davidson <t.lee.davidson at gmail.com>
To: user at lists.gambas-basic.org
Sent: Wed, 20 Sep 2023 17:01:45 -0400
Subject: Re: [Gambas-user] How to load a new page on gb.web by code

> On 9/20/23 14:50, Benoît Minisini wrote:
> > You must create one WebPage for each page in one project.
> > 
> > Then you create a startup module Main, and from the Main method of that Main module, you choose the page you want to render, 
> > according to the value of 'Request.Path'.
> 
> Mayost,
> 
> Benoit just confirmed what I was thinking about using a Main module. (But, I 
> hadn't thought of using Request.Path - nice tip.)
> 
> Based on this, I have created a small demonstration project. The way I have 
> done things is probably not the best way especially given the use of global 
> variables in the Main module. But, perhaps it will give you some ideas.
> 
> -- 
> Lee
> 
> P.S. If you're confused about the format of the attachment, see https://gambaswiki.org/wiki/howto/opengmailtxt
------- End of Original Message -------

Hello
Thank you

It helped me move forward

Regarding the Request.Path issue, I still don't understand what it can solve

Suppose I write on the page in the part of the form like this:
<form class="form-floating" method="post" action="Webpage1.webpage">
1. If I'm inside the IDE it doesn't do anything, it doesn't really open the page
2. If I compile the project and put it inside the HTTPD server
Then I go to:
http://127.0.0.1/cgi-bin/w7.gambas
I get the page fine
But if I click the submit button
It says that there is no such page and in the address line of the browser you see that it has changed to
http://127.0.0.1/cgi-bin/Webpage1.webpage


More information about the User mailing list