not knowing which forum i should really post this in, i have seen Use SSI, not frames a couple times now and am wondering what SSI is exactly. thx Server Side Includes. If your server environment supports it (and many do) then you can "assemble" a final page from several fragments using a tag based markup like
<!--#include file="globnav.htm" -->
There are several common syntax variations depending on whether you're using Apache SSI, ASP, PHP or other. You can also roll your own using CGI if that's all you've got.not sure i really understand If you have server side languages installed on your server, then you can use the server side include functions they offer. For example, if you have PHP, then you can use the include() function (morei nfo (<!-- m --><a class="postlink" href="http://www.w3schools.com/php/php_includes.asp">http://www.w3schools.com/php/php_includes.asp</a><!-- m -->)).
Also, if your server allows server side includes, then you can use the code Ray offered within a .shtml file, where the file name in the quote's contents will be retreived and placed wherever you place that line of code.
Was I any more clear...?ok, that helps thx. so ill be learning more about it when i learn php in a little bit thxNo problem. Originally posted by pawky
not sure i really understand
SSI is a great tool. I use it all the time. The internet is full of tutorials explaining it in more detail. Check this list (<!-- m --><a class="postlink" href="http://directory.google.com/Top/Computers/Programming/Internet/SSI/">http://directory.google.com/Top/Compute ... ernet/SSI/</a><!-- m -->).I was thinking erm? what? when I first read the replies but now I understand.
I made a test one to see if it worked and it did using a page with divs to set the layout so its the same as every other page, but how would you set what content is on that page? Im a tad confused again Well, I would provide some code as example, but I need to know if you're using PHP or SHTML...I used PHPThen there's a few possibilities, but I think the best looking is to have a file for each page as usual, and at the top:
<?php include($_SERVER['DOCUMENT_ROOT']."/path/to/header.php");?>
...
Page contents
...
<?php include($_SERVER['DOCUMENT_ROOT']."/path/to/footer.php");?>Ah I get ya, thanks for clearing that up Omega No problem. Im stuck again,
How would I get text to go into a certain DIV? All the include() does is get the contents of the file and place it where the includes lay. So if the header file had
<html>
<head>
<title>Foo</foo>
</head>
<body>
<h1>Foo</h1>
<div>
and the footer had </div>
</body>
</html>
Then the source code of <?php include($_SERVER['DOCUMENT_ROOT']."/path/to/header.php");?>
...
Page contents
...
<?php include($_SERVER['DOCUMENT_ROOT']."/path/to/footer.php");?> would be
<html>
<head>
<title>Foo</foo>
</head>
<body>
<h1>Foo</h1>
<div>
...
Page contents
...
</div>
</body>
</html>
Did that make any more sense to you?Yeah cheers omega...again No problem ... again. Hiya.
Quick question.
Is there any benefit to using:
<?php include($_SERVER['DOCUMENT_ROOT']."/path/to/footer.php");?>
over:
<?php include("/path/to/footer.php"); ?>
?
Thanks.I don't know about you, but for me, that results in an error. Using $_SERVER['DOCUMENT_ROOT'] is the only way to include() files in a different subdirectory.
<!--#include file="globnav.htm" -->
There are several common syntax variations depending on whether you're using Apache SSI, ASP, PHP or other. You can also roll your own using CGI if that's all you've got.not sure i really understand If you have server side languages installed on your server, then you can use the server side include functions they offer. For example, if you have PHP, then you can use the include() function (morei nfo (<!-- m --><a class="postlink" href="http://www.w3schools.com/php/php_includes.asp">http://www.w3schools.com/php/php_includes.asp</a><!-- m -->)).
Also, if your server allows server side includes, then you can use the code Ray offered within a .shtml file, where the file name in the quote's contents will be retreived and placed wherever you place that line of code.
Was I any more clear...?ok, that helps thx. so ill be learning more about it when i learn php in a little bit thxNo problem. Originally posted by pawky
not sure i really understand
SSI is a great tool. I use it all the time. The internet is full of tutorials explaining it in more detail. Check this list (<!-- m --><a class="postlink" href="http://directory.google.com/Top/Computers/Programming/Internet/SSI/">http://directory.google.com/Top/Compute ... ernet/SSI/</a><!-- m -->).I was thinking erm? what? when I first read the replies but now I understand.
I made a test one to see if it worked and it did using a page with divs to set the layout so its the same as every other page, but how would you set what content is on that page? Im a tad confused again Well, I would provide some code as example, but I need to know if you're using PHP or SHTML...I used PHPThen there's a few possibilities, but I think the best looking is to have a file for each page as usual, and at the top:
<?php include($_SERVER['DOCUMENT_ROOT']."/path/to/header.php");?>
...
Page contents
...
<?php include($_SERVER['DOCUMENT_ROOT']."/path/to/footer.php");?>Ah I get ya, thanks for clearing that up Omega No problem. Im stuck again,
How would I get text to go into a certain DIV? All the include() does is get the contents of the file and place it where the includes lay. So if the header file had
<html>
<head>
<title>Foo</foo>
</head>
<body>
<h1>Foo</h1>
<div>
and the footer had </div>
</body>
</html>
Then the source code of <?php include($_SERVER['DOCUMENT_ROOT']."/path/to/header.php");?>
...
Page contents
...
<?php include($_SERVER['DOCUMENT_ROOT']."/path/to/footer.php");?> would be
<html>
<head>
<title>Foo</foo>
</head>
<body>
<h1>Foo</h1>
<div>
...
Page contents
...
</div>
</body>
</html>
Did that make any more sense to you?Yeah cheers omega...again No problem ... again. Hiya.
Quick question.
Is there any benefit to using:
<?php include($_SERVER['DOCUMENT_ROOT']."/path/to/footer.php");?>
over:
<?php include("/path/to/footer.php"); ?>
?
Thanks.I don't know about you, but for me, that results in an error. Using $_SERVER['DOCUMENT_ROOT'] is the only way to include() files in a different subdirectory.