Click to See Complete Forum and Search --> : shtml help (server side include problem)


tu2thepoo
12-20-2002, 02:12 AM
http://www.actvsdei.com/~tutu/temp/test4.shtml

here's what i have now:


<body bgcolor="#006699">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" height="95%" align="center">
<!--#include file="leftside.txt" -->
</td>
<td width="80%" height="95%" align="center">
<!--#include file="content.txt" -->
</td>
<td width="10%" height="95%" align="center" valign="top">
<!--#include file="rightside.txt" -->
</td>
</tr>
<tr>
<td height="5%" colspan="3" align="center" valign="top">
<!--#include file="bottom.txt" -->
</td>
</tr>
</table>
</body>

content.txt contains the table formatting stuff. this is what it looks like without including content.txt (http://www.actvsdei.com/~tutu/temp/test5.shtml).

what i'd like to do is keep the content (which would be on the .shtml page) separate from the formatting information in content.txt, so that if i change the layout in the future i won't have to go through every page of my website and reformat that particular window. is this possible using shtml?

For example, i don't like the look of the bones around the content window right now, so i want to be able to change how it looks (by modifying content.txt) without screwing up anything i have in the content window.

i'm thinking it might be more elegant to use PHP or something similar, but i'm not too sure if my account is properly set up for that (i get missing file errors when i try to use php-include).

Grizzly
12-20-2002, 11:07 AM
I would just take all of the table formatting contained in "content.txt" and leave it in the root file. The only characters that should be left in your "content.txt" file should be "content goes here"

Make sense? If you used PHP for your includes, you could nest includes and makes things a little more modular, but I'm not sure if you really need that type of flexibility right now. Keep it simple if you can.

tu2thepoo
12-20-2002, 11:39 AM
[edit]
nevermind, i got php-include working. i think i had errors before because i was trying to include .html files (instead of .inc).

this is what i have now:

<html>
<head>
<?php include "title.inc" ?>
<?php include "meta.inc" ?>
<link href="main.css" rel="stylesheet" type="text/css">
<?php include "scripts.inc" ?>
</head>

<body bgcolor="#006699">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" height="95%" align="center">
<?php include "leftside.inc" ?>
</td>
<td width="80%" height="95%" align="center">
<?php include "contentformat.inc" ?>
</td>
<td width="10%" height="95%" align="center" valign="top">
<?php include "rightside.inc" ?>
</td>
</tr>
<tr>
<td height="5%" colspan="3" align="center" valign="top">
<?php include "bottom.inc" ?>
</td>
</tr>
</table>
<!-- following a tutorial right now -->
<?php

print ("I am the CHICKEN MAN");

?>
</body>
</html>


so how could i go about nesting the includes? this is my first foray into PHP, so i'm still thumbing through the documentation on php.net.


link is now
http://www.actvsdei.com/~tutu/temp/test.php

tu2thepoo
12-21-2002, 11:18 PM
that was (http://www.actvsdei.com/~tutu/temp/test.php?PageName=content1.php) a lot easier than i thought (http://www.actvsdei.com/~tutu/temp/test.php?PageName=content2.inc)