Page 1 of 1

Structure of the site

Posted: Sat Oct 21, 2006 11:32 am
by pedro84
Hello!

I wanna to ask You guys if I'm writing my site in good way

index.php:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Michael-Schenker.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250"/>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head> 


<?php
include('includes/header.php');
?>

<?php
include('includes/menu.php');
?>

<?php
include('includes/content.php');
?>

<?php
include './include.php';
?>

<?php
include('includes/footer.php');
?>

ew. included file:

Code: Select all

<?php

echo "<div id=\"footer\"><p id=\"copy\">Copyright 2006 Michael-Schenker.com</p></div>\n";
echo "</div>\n";
echo "</div>\n";

echo "</body>\n";
echo "</html>\n";

?>

Posted: Sat Oct 21, 2006 12:45 pm
by alex.barylski
It's fine, but could be better...

Use a template engine like Smarty or Savant...they do what your doing but better. ;)

Posted: Sat Oct 21, 2006 12:47 pm
by pedro84
Hockey: Thank You, I'll do what You say. Thank You once again. But I don't understand one thing? Smarty is for webistes with more that one layout?
No Capisco:)

Posted: Sat Oct 21, 2006 3:23 pm
by RecoilUK
Hi

In my opinion, you should have a template folder, in which you put mainly HTML but still use a .php extension.

Then your main pages, menu.php would have the program logic in them, they then intrun call the necessary include files.

Template engines are a waist of time, when PHP is a very good templating engine already.

Just my opinion, others will disagree.

Thanks

Posted: Sat Oct 21, 2006 3:25 pm
by pedro84
I think I'm too n00bie to php, to make it:(

Posted: Sat Oct 21, 2006 6:02 pm
by Chris Corbyn
pedro84 wrote:I think I'm too n00bie to php, to make it:(
Never :) You're already halfway to templating. If you can separate out anything that's not directly related to what's displayed on-screen then you're basically templating.

Posted: Sat Oct 21, 2006 6:06 pm
by pedro84
I'm using Smarty. But now, I can't add any site. Only mainpage :lol:
It's getting veeeery funny:) :lol:
I'm frustrated:)