Jump to content

New site/ some questions


pedro84

Recommended Posts

WElcome Everyone!

I wanna to ask You some questions:

index.php
[code]<!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('includes/footer.php');
?>


[/code]
ew. included file

[code]<?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";

?>[/code]

Am I doing it right? Is it good way to make my site validating?
Link to comment
https://forums.phpfreaks.com/topic/24670-new-site-some-questions/
Share on other sites

You don't have to go in and out of PHP for the includes.
[code]<?php
include('includes/header.php');
include('includes/menu.php');
include('includes/content.php');
include('includes/footer.php');
?>[/code]

Everyone has his or her preference when writing HTML code from php. Some people prefer the HEREDOC method:
[code]<?php
echo <<<EOF
<div id="footer"><p id="copy">Copyright 2006 Michael-Schenker.com</p></div>
</div>
</div>
</body>
</html>
EOF;?>[/code]

Some people prefer to use one long string:
[code]<?php
echo "<div id='footer'><p id='copy'>Copyright 2006 Michael-Schenker.com</p></div>
</div>
</div>
</body>
</html>\n";?>[/code]

You can write code that won't validate no matter you chose to write it.

Ken
I fixed them. I have next question:

How to make structure as follow:
_root =>index.php
data => files ex. discography

How to make them? I tried but I got errors that cannot find path:|

Sorry for my  maybe stupid questions but I want to make it good.

Thank You once again.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.