Hi Leute,
ich hab vor den Gerüst meiner Website mal komplett umzubauen. Also die Seite an sich soll so bleiben wie sie ist, außer da sich das Design nochmals ändere. Aber das tut nichts zur Sache.
Also ich wollte jetzt mal nachfragen, ob es sinnvoll ist wen ich den HTMLcode von PHP erzeugen lasse, mittels "echo".
Das ich oben in der index.php den HTML-Header als externe "html_header.php" include und dann im body den ganzen krempel mit echo ausführe zb.:
PHP
echo "<div class='menu_box_center'>";
include 'get_counter.php';
echo "</div></li>";
echo "<li class='abstand'><div class='menu_links'><a class='link' href='index.php?action=news'>News</a> ►</div></li>";
if ($_GET['action'] == "about" or $_GET['action'] == "hobbys" or $_GET['action'] == "konzerte" or $_GET['action'] == "steckbrief") { ?>
ist es so sinnvoller? also in meiner Index.php kommt schon einiges an html vor:
index.php
PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- ____________________Copyright © 2009 by Max Boll [MyXoToD]____________________ -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php include ("get_title.php"); ?></title>
<link rel="shortcut icon" type="image/x-icon" href="skin/template/images/icon1.ico" />
<link rel="stylesheet" type="text/css" href="skin/template/css/style.css" />
<link rel="stylesheet" type="text/css" href="skin/template/css/lightbox.css" media="screen" />
<meta name="title" content="MyXoToD" />
<meta name="description" content="Website Privat Homepage von Max Boll MyXoToD" />
<meta name="keywords" content="max, boll, privat, homepage, website, myxotod, pen spinning, rubiks cube, php, html, tutorial, blog, startseite, über mich, hobbys, konzerte, steckbrief, impressum, kontakt, sitemap, partner, links, link me, gästebuch, downloads, support, tutorials, artwork, videos, bilder, twitter, willkommen" />
<meta name="owner" content="maxi-boll@hotmail.de" />
<meta name="author" content="Max Boll" />
<meta http-equiv="expires" content="" />
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="content-language" content="Deutsch" />
<meta http-equiv="vw96.object type" content="Homepage" />
<meta name="rating" content="Alle" />
<meta name="robots" content="index,follow" />
<meta name="revist-after" content="1 Days" />
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
</head>
<body>
<!-- ____________________Beginn-Header-Bereich____________________ -->
<div class="header_container">
<div class="header_space_top">
</div>
<div class="header_banner">
</div>
<div class="header_space_bottom">
</div>
</div>
<!-- ____________________Beginn-Main-Bereich____________________ -->
<div class="main_container">
<!-- ____________________Rootleiste-Oben____________________ -->
<div class="navi_box">
<div class="page_trail">
Sie befinden sich hier:
<?php
include 'get_pagetrail.php';
?>
</div>
</div>
<div class="main_space_top">
</div>
<!-- ____________________Menü-Links____________________ -->
<div class="main_menu">
<div class="menu_box_top">
</div>
<div class="menu_box_center">
<ul class="keine_punkte">
<li><div class="counter">
<?php
include 'get_counter.php';
?>
</div></li>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=news">News</a> ►</div></li>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=about">Über mich</a> ►</div></li>
<?php if ($_GET['action'] == "about" or $_GET['action'] == "hobbys" or $_GET['action'] == "konzerte" or $_GET['action'] == "steckbrief") { ?>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=steckbrief">Steckbrief</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=hobbys">Hobbys</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=konzerte">Konzerte</a></div></li>
<?php } ?>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=blog">Blog</a> ►</div></li>
<?php if ($_GET['action'] == "blog" or $_GET['action'] == "twitter") { ?>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=twitter">Twitter</a></div></li>
<?php } ?>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=bilder">Bilder</a> ►</div></li>
<?php if ($_GET['action'] == "bilder" or $_GET['action'] == "trampolin08" or $_GET['action'] == "10.04.-13.04.09_mit_ilka") { ?>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=trampolin08">Trampolin '08</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=10.04.-13.04.09_mit_ilka">10.04. - 13.04.09 mit Ilka</a></div></li>
<?php } ?>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=videos">Videos</a> ►</div></li>
<?php if ($_GET['action'] == "videos" or $_GET['action'] == "funvideos" or $_GET['action'] == "videotutorials") { ?>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=funvideos">Fun Videos</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=videotutorials">Video Tutorials</a></div></li>
<?php } ?>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=artwork">Artwork</a> ►</div></li>
<?php if ($_GET['action'] == "artwork" or $_GET['action'] == "signaturen" or $_GET['action'] == "wallpaper" or $_GET['action'] == "fotografie" or $_GET['action'] == "zeichnungen") { ?>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=signaturen">Signaturen</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=wallpaper">Wallpaper</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=fotografie">Fotografie</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=zeichnungen">Zeichnungen</a></div></li>
<?php } ?>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=tutorials">Tutorials</a> ►</div></li>
<?php if ($_GET['action'] == "tutorials" or $_GET['action'] == "phpmysql" or $_GET['action'] == "htmlcss" or $_GET['action'] == "photoshop" or $_GET['action'] == "sonyvegas") { ?>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=phpmysql">PHP & MySQL</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=htmlcss">HTML & CSS</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=photoshop">Photoshop</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=sonyvegas">Sony Vegas</a></div></li>
<?php } ?>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=support">Support</a> ►</div></li>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=downloads">Downloads</a> ►</div></li>
<?php if ($_GET['action'] == "downloads" or $_GET['action'] == "dgalerie1" or $_GET['action'] == "dgalerie2" or $_GET['action'] == "dgalerie3") { ?>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=dgalerie1">Galerie 1</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=dgalerie2">Galerie 2</a></div></li>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=dgalerie3">Galerie 3</a></div></li>
<?php } ?>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=gaestebuch">Gästebuch</a> ►</div></li>
<?php if ($_GET['action'] == "gaestebuch" or $_GET['action'] == "gaestebuch#unten") { ?>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=gaestebuch#unten">Eintrag verfassen</a></div></li>
<?php } ?>
<li class="abstand"><div class="menu_links"><a class="link" href="index.php?action=links">Links</a> ►</div></li>
<?php if ($_GET['action'] == "links" or $_GET['action'] == "linkme") { ?>
<li class="sub_menu" style="#0070b0"><div class="menu_sub_links"><a class="link" href="index.php?action=linkme">Link me</a></div></li>
<?php } ?>
</ul>
</div>
<div class="menu_box_bottom">
</div>
</div>
<div class="main_space_center">
</div>
<!-- ____________________Inhalt-Rechts____________________ -->
<div class="main_inhalt">
<div class="inhalt_box_top">
</div>
<div class="inhalt_box_center">
<?php
include 'get_content.php';
?>
</div>
<div class="inhalt_box_bottom">
</div>
</div>
<div class="main_space_bottom">
</div>
</div>
<!-- ____________________Fußzeile____________________ -->
<div class="footer_container">
<div class="acp_login">
<div class="acp_link"><a class="link" href="index.php?action=login">ACP</a>►</div>
</div>
<div class="footer_menu">
<div class="menu_sub_links"><a class="footer" href="index.php?action=impressum">Impressum</a> | <a class="footer" href="index.php?action=kontakt">Kontakt</a> | <a class="footer" href="index.php?action=sitemap">Sitemap</a></div>
</div>
<div class="footer_box">
<div class="footer_text">
<?php
include 'get_footer.php';
?>
</div>
</div>
<div class="footer_space_bottom">
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-10077192-3");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>
Alles anzeigen
Also wie gesagt, Header und Footer sollten dann includiert werden und der inhalt wird sowieso aus anderen Dateien Includiert.
MfG Santos