shtml help (server side include problem)

Sharky Forums


Results 1 to 4 of 4

Thread: shtml help (server side include problem)

  1. #1
    BANANARAMA FOFANA tu2thepoo's Avatar
    Join Date
    Dec 2000
    Location
    BLARRRG.
    Posts
    5,756

    shtml help (server side include problem)

    http://www.actvsdei.com/~tutu/temp/test4.shtml

    here's what i have now:

    Code:
    <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.

    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).
    Last edited by tu2thepoo; 12-20-2002 at 03:14 AM.

  2. #2
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077
    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.

  3. #3
    BANANARAMA FOFANA tu2thepoo's Avatar
    Join Date
    Dec 2000
    Location
    BLARRRG.
    Posts
    5,756
    [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:
    Code:
    <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.

    [edit2]
    link is now
    http://www.actvsdei.com/~tutu/temp/test.php
    [/edit2]
    Last edited by tu2thepoo; 12-20-2002 at 01:36 PM.

  4. #4
    BANANARAMA FOFANA tu2thepoo's Avatar
    Join Date
    Dec 2000
    Location
    BLARRRG.
    Posts
    5,756
    that was a lot easier than i thought

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •