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

Benoît Minisini benoit.minisini at gambas-basic.org
Thu Sep 21 12:11:55 CEST 2023


Le 21/09/2023 à 07:56, Mayost Sharon a écrit :
> 
> 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
> 

<form class="form-floating" method="post" action="Webpage1.webpage">

The 'action' attribute is an URL, not the name of Gambas class inside 
your project.

I think you mistake what happens on the client, and what happens on the 
server.

How can you map the URL to your webpage? Inside the server code, by 
using the 'Request.Path' property. It tells you the URL of the request, 
from which you decide which WebPage you will display (or not, depending 
on the request).

Regards,

-- 
Benoît Minisini.



More information about the User mailing list