Hallo Leute,
ich bin auch mal wieder da^^
Ich habe mich sehr lange mit anderen Sachen beschäftigt und da kam ich so aus der Übung und wollte mal fragen was ich hier falsch mache:
PHP
- <a href="test.php?site=_news.php">News</a>
- <a href="test.php?site=_about.php">About</a>
- <a href="test.php?site=_about.php">Links</a>
- <a href="test.php?site=_kontakt.php">Kontakt</a>
- <?php
- switch($site)
- {
- case news:
- $content = "news.php";
- break;
- case about:
- $content = "about.php";
- break;
- case links:
- $content = "links.php";
- break;
- case kontakt:
- $content = "kontakt.php";
- break;}
- ?>
- <div align="right">
- <?
- include($content);
- ?>
- </div>
Es soll eine Navigation per switchcase werden doch ihwie funzt da garnichts und der Content bleibt immer gleich.
Wie muss der Code richig lauten?
Diese Dateien liegen im selben Ordner:
test.php
news.php
about.php
links.php
kontakt.php
Mfg