pedro84 Posted October 21, 2006 Share Posted October 21, 2006 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> <?phpinclude('includes/header.php');?><?phpinclude('includes/menu.php');?><?phpinclude('includes/content.php');?><?phpinclude('includes/footer.php');?>[/code]ew. included file[code]<?phpecho "<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 More sharing options...
kenrbnsn Posted October 21, 2006 Share Posted October 21, 2006 You don't have to go in and out of PHP for the includes.[code]<?phpinclude('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]<?phpecho <<<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]<?phpecho "<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 Link to comment https://forums.phpfreaks.com/topic/24670-new-site-some-questions/#findComment-112366 Share on other sites More sharing options...
pedro84 Posted October 21, 2006 Author Share Posted October 21, 2006 Don't understand at all:)But when I'm validating my source is it good:) Link to comment https://forums.phpfreaks.com/topic/24670-new-site-some-questions/#findComment-112367 Share on other sites More sharing options...
Psycho Posted October 21, 2006 Share Posted October 21, 2006 You do not validate the PHP, you validate the HTML that the PHP produces. So, this really isn't a PHP question. But, I don't see anything glaringly wrong with your code, but you can always submit it for validation. (search on google) Link to comment https://forums.phpfreaks.com/topic/24670-new-site-some-questions/#findComment-112423 Share on other sites More sharing options...
pedro84 Posted October 22, 2006 Author Share Posted October 22, 2006 Another question.Do I have to have css link in all pages? How to include it? Link to comment https://forums.phpfreaks.com/topic/24670-new-site-some-questions/#findComment-112625 Share on other sites More sharing options...
JasonLewis Posted October 22, 2006 Share Posted October 22, 2006 just link the css on your index.php page like you already have. but instead of doing your html like you have done above in one of your included files, do what ken said. it is a lot more error free. Link to comment https://forums.phpfreaks.com/topic/24670-new-site-some-questions/#findComment-112635 Share on other sites More sharing options...
pedro84 Posted October 22, 2006 Author Share Posted October 22, 2006 I fixed them. I have next question:How to make structure as follow:_root =>index.phpdata => files ex. discographyHow 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. Link to comment https://forums.phpfreaks.com/topic/24670-new-site-some-questions/#findComment-112644 Share on other sites More sharing options...
JasonLewis Posted October 23, 2006 Share Posted October 23, 2006 not sure what you mean... if you want to link to your index file and it is in the same as the file your linking from just do:[code=php:0]include './index.php';[/code] Link to comment https://forums.phpfreaks.com/topic/24670-new-site-some-questions/#findComment-113032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.