Page 1 of 1

Newbie Question: Templates (Can they be done only in html?)

Posted: Wed Jan 08, 2003 2:20 am
by Mephisto Nightbane
I know it's kind of newbish, but hey, that's all me! :D Anyway. I'm trying to diversify my site, I want to make a site with PHP, FLASH, and HTML (no frames, frames is tacky). And I'm wondering if I can port the templates into HTML only or do I need PHP to make the Header, Main Section, and Footer all come together as one?

If that's the case...

Here's the other question...

How does one go about mashing the three together in PHP? I've been searching around, and being told to download this, download that. I just want straight code on how to mash the three together, nothing too complex... But I would however like a reason for what the code does rather than

"Just Copy This:

Code: Select all

<html>
<body>
STUFF
</body>
</html>
"

I created my templates in Dreamweaver 4 and I would like to know If I have to convert them from the dw template files to *.tpl files, or if I can just leave em as they are... If you have extensions available to quicken this processus up, a link would be much appreciated as well...

I hope that my questions are not too... "Pressing" as I would simply like direct and concise info (Every other forum gives me the same bs in overly complex jargon that I cannot understand for the life of me!).

Thank you in advance for any help you may provide, and if I get my server going... I'll throw up a link to the mainsec.html, header.html, and footer.html files if I get the chance, and if my server lets me...

Good Day,
-=(v)=-

Posted: Wed Jan 08, 2003 2:56 am
by DaZZleD

Code: Select all

&#1111;php]<?php
  $header = readdatafromdisk("header.php");
  $footer = readdatafromdisk("footer.php");

  function readdatafromdisk($filename)
  &#123;
     set_magic_quotes_runtime(0);  
     $fd = fopen ($filename, "r");
     $tempvar = fread ($fd, filesize ($filename));
     set_magic_quotes_runtime(get_magic_quotes_gpc());
     return $tempvar;
  &#125;
?>&#1111;/php]

<html>
<head>
</head>

<body leftmargin="0" topmargin="0">
&#1111;php]<?php
echo $header;
?>&#1111;/php]

//body stuff

&#1111;php]<?php
echo $footer;
?>&#1111;/php]
</body>
</html>

you can add this to your template then for each page you create from the template modify the footer and header to load. be aware that both header.php and footer.php must not contain any <html><title></title><body></body></html> tags. you simply create the header and footer as any other page in dreamweaver then delete all except what's between <body></body> tags then save the file.