Log in

View Full Version : how to do ssi


joeydood
10-03-2003, 11:47 PM
ok guys, i've been goin nuts at this.

i've done it before in the html / asp world a billion times but can't get it working here:
neither of these seem to be working!!! the test.htm file is in the /forums/ directory and i'm trying to include it in the forumheader template.

i've put in a support ticket to see if the servers have ssi enabled.

help a newb out!


<!--#include virtual="test.htm" -->
<?php include ("test.htm"); ?>
<!--#include virtual="../forums/test.htm" -->
<!--#include virtual="/public_html/forums/test.htm" -->

sabret00the
10-04-2003, 12:28 AM
what file are you trying to include it into?

<?php include(file.php); ?>

will work in php but not sure about asp and what not, aint tinkered tbh

Tigga
10-04-2003, 04:16 AM
Maybe this?

<?php include ("./test.htm"); ?>

Sylvus
10-04-2003, 01:57 PM
Well, make sure your file extension is .shtml before attempting to do any SSI includes. You may already be doing this but it was not mentioned in your first post.

The syntax you have for using an "SSI include" in a .shtml filename are correct and my guess as to why it's not working is because the template does not have a .shtml extension.

I was unable to get any includes working in the footer or header portion found in the control panel myself.

Syl...

joeydood
10-04-2003, 08:42 PM
sorry for the lack of info... here goes, i'm gonna fill in the whole story here...

in html or asp, i can just put

<!--#include virtual="/includes/test.txt"-->

and bam, wherever that include directive is, test.txt is inserted.

now, what i'm trying to do is incorporate my menu buttons into a source .html file; and include that file in one of my templates.

it seems that i'm going to have to use the following method...

<?php include ("test.htm"); ?>

because templates are...

please set me straight here someone...

not just plain html. they're php, right?

so if i want to include a .txt or .html file into a php template, let's say the header... i have to use the php include directive, correct?

lemmie know if i'm not making sense. this is driving me nuts and it's easy! sheesh! well it's all easy when you 'know' it!

joeydood
10-04-2003, 08:53 PM
doesn't look like the <?php thingy works either.
the path to my include is /includes/test.txt

i can do a txt or html can't i?

Tigga
10-04-2003, 10:31 PM
Ahhh... I overlooked the part where you said you were trying to use SSI in a template. I know I tried to do the same a while ago and I'm pretty sure it won't work. It may help to ask over at vB.com as well though...