Includes: SSI or PHP for basic HTML and Javascript in separate files

I started my Xampp server and can now run my html in subdirectories (there can be no spaces in subdirectory names).

SSI Includes or PHP Includes:

Xampp says SSI is deactivated. Tried uncommenting lines for inclusions, but it doesn't change deactivation.

How do I activate SSI?

Then, how do I implement either SSI include statements or PHP include instructions in my html to call html files containing html, images, javascript and commands that call other javascript menu files?

0


source to share


3 answers


I don't know if Xampp has a special way to activate SSI or not, but the normal Apache way should work .

The usual way to include files in SSI is



<!--#include virtual="/something/file.html" --> 

      

where the url of the file is actually http://www.example.com/something/file.html .

+1


source


PHP includes pretty simple. Just name your file something.php and do this:

<?php include('path/to/file.php'); ?>

      



The file will be processed by php, so it can contain the standard PHP / HTML tag mix or whatever text you want.

0


source


If XAMPP says SSI is disabled by default, then you need to change your server configuration ( not the .HTACCESS file ) to change that. Otherwise, you can try installing a plugin for your server to fix the problem.

Hope this helps!

~ Nate.

0


source







All Articles