Server Side Includes and Server Connects

Hi,
Here’s another question from a non-programmer on day 4 of the trial. This one comes with a long intro.

  1. I followed one of the video instructions and created a page with server connects to logout and to get the user roles.
  2. The role is used in the header to hide or show elements in the nav bar inside it.
  3. I then made the header a server-side include (ssi-header.php) and it all works as expected.
  4. The process that creates the ssi-header-php does not include in the resulting file the server connects, so technically, in order for the ssi- to work in a new page, I have to include the server connects in the new page.
  5. I edited the ssi-header.php and put inside it the server connects and the browser element . I wanted to test if Wappler allowed me to make the ssi-header.php as self-contained as possible, encapsulating in it all the components that SSI needs, thus removing the reliance on my memory to place those components in every page where I include the ssi-header.php.
  6. I tested this arrangement of having the server connects inside the SSI file and everything seems to work fine. (Sorry if I sound a bit surprised that it did, but I’m really new in this field.)
  7. Moreover, I verified that a page that in its App Structure has the ssi-header.php component only still “sees” the server connects that are part of the ssi-header.php now and can take from them, for example, variables like the username and the role. This seems to ensure that I don’t need to include twice the different server connects.

So here are the questions:
a) Is there any problem with what I did ?
b) Are there good reasons for keeping the server connects and the browser element in the page?
c) are there any elements for which doing what I did would be a bad idea?

Many thanks!

Alex

Community Page
Last updated: