简体   繁体   中英

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

I got my Xampp server running and can run my html in subdirectories now, as well (can't have spaces in the subdirectory names).

SSI Includes or PHP Includes:

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

How do I activate SSI?

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

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

The normal way to include files in SSI is

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

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

If XAMPP says SSI are disabled by default, you need to edit your server configuration ( not your .HTACCESS file ) to change this. Otherwise, you could try installing a plugin for your server to fix the issue.

Hope this helps!

~ Nate.

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

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

The file will be parsed by php so it can contain the standard mix of PHP/HTML tags or whatever other text you'd like.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM