Server side include (php include) - moves include out of <head>


I used includes for stylesheets or any other scripts i might have to use in the future.
So normally the structure would be adding the include above the head… as image below.

Please note im only using / AppConnect nothing else for the testing

But when i save the file. It removes the include file out of the head and place this within the body tag

======== TEMPLATE BUG FORM ========

Wappler Version: 1.9.9
Operating System: windows 7


Sorry it seems you need to use <?php require_once 'stylesheets.php';?> if you want to keep using a include in the but the only problem then is it wont “render” the content in Wappler


As far as I know PHP Includes are used to place reusable content inside a page body and Wappler is keen enough to see that it has to move the include to the body part.
To include custom style sheets you may use “attach style sheet” stylesheet


Yes i hear you … but i use “includes” for “scripts” and “multi stylesheets”.

So that i dont have to go to every single page… its just weird that it moves the “include file tag” back into the body if i placed it above the

stylesheets i would include…

or scripts i would “include” to re-use


I mentioned this or a similar problem quite a while ago - in relation to using a PHP include in the <head> section - eg for meta tags. This does seem to be a problem which should be fixed.

In the case of your javascript example, couldn’t you just use a link to a .js file rather than a .php file?


Hi TomD … thanks for the reply… i did do a search but could not find your topic… maybe my search tags did not correspond with your post

The same goes for my Javascript file. I like keeping the javascripts in files for debugging and easy to change in a file archive. or just script it out… lol… just my silly way of doing this… and not keep 1 very very long js file…


I couldn’t find my post either. Essentialy, it concerned a problem where the code was rewritten on closing/reopening a file, making it impossible to use a PHP include for meta tags - similar to your problem. It seems this is still a problem.