NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Rene Simons on December 10, 2023, 01:26:42 PM

Title: Static index.html and parameters
Post by: Rene Simons on December 10, 2023, 01:26:42 PM
Hi,

I have a static page (index.htm)
When I call for the page and send some parameters along, like /index.html?a=1&b=2,
what is the best place to "receive" the data for these parameters?
Would that be the webhandler procedure, right after the code statement?

Cheers,
Ren?
Title: Re: Static index.html and parameters
Post by: Bruce on December 11, 2023, 10:10:29 PM
A "static page" implies "it doesn't change".
So what are you planning to do with the parameters?

If it truly is just a file off the disk, then yes, you can access the parameters in WebHandle, _SendFile method.
using p_web.GetValue('parametername')

Cheers
Bruce
Title: Re: Static index.html and parameters
Post by: Rene Simons on December 11, 2023, 10:44:28 PM
Hi Bruce,

Thanks for the info.
Actually, it s a static html with some <!-- Net:xxx --> thingies in it.
Some menu options refer to the same page. The parameters are used to change some session values and execute some functions in the page.

Ren?

Title: Re: Static index.html and parameters
Post by: Bruce on December 11, 2023, 11:43:30 PM
Hi Rene,

A better pattern is to use say a form as the container, and then allow static HTML to be injected into the form.

Your approach will work, but you'll discover it's harder to maintain, and harder to construct.

Cheers
Bruce
Title: Re: Static index.html and parameters
Post by: Rene Simons on February 03, 2024, 10:28:15 AM
Hi Bruce,

As I was struggeling along with my web-solution, I decided to follow your advice and create an example app.
During that process I had to trace back my steps and as a result I have a proper working example now.
So no further questions about this. Problem solved.
Thanks for your encouragement.

Cheers,
Ren?