You are currently browsing the page SHTML basic page in the Miscellaneous category.

SHTML basic page

SHTML or SSI works exactly as PHP Inclusion! Don't forget, if you want to make a SHTML page, the extension must be .shtml or .shtm! Well, so make your page, with the design, etc. If you've understood it, I recommend you to use PHP inclusion instead. :)

<html>
<head>
<title>Welcome to my webpage</title>
</head>
<body>
<!-- Layout code -->
<p>CONTENTS</p>
<!-- Layout code -->
</body>
</html>

Okay, now you will have to separate it in three parts, the header, the contents and the footer. Open a new document and paste your header. The header is everything before the contents. Save it as header.htm

<html>
<head>
<title>Welcome to my webpage</title>
</head>
<body>
<!-- Layout code -->

Now, open an other document and paste the footer. The footer is everything after the contents. Save it as footer.htm

<!-- Layout code -->
</body>
</html>

Good, now, open a new document and paste this:

<!--#include virtual="header.htm" -->
<!--#include virtual="footer.htm" -->

Save it as index.shtml! Good, you're almost done!! Now, just add the contents!! :D

<!--#include virtual="header.htm" -->
<p>Hello welcome! Blah blah!</p>
<!--#include virtual="footer.htm" -->

To make the other pages, you just have to repeat this step! For exemple:

<!--#include virtual="header.htm" -->
<p>This is another page!</p>
<!--#include virtual="footer.htm" -->

And save it as page1.shtml or whatever! =)

Print This Post Print This Post



Sponsors


Leave a Comment

Works? Doesn't work? Other tips? Please leave a comment! :)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

To post codes, please go to SimpleCode and transform your codes first, so that it will displayed properly. Indeed, < and > need to be converted to &lt; and &gt; :)


Close
E-mail It