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! =)
Related Posts
Sponsors
Leave a Comment
Works? Doesn't work? Other tips? Please leave a comment! :)