Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
<?php
error_reporting(e_all | e_strict);
if (!headers_sent()) { header("Content-Type: text/html; charset=utf-8"); }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<?php
$view=(isset($_get["view"]))? $_get["view"]:"";
$kat =(isset($_get["kat"]))?' -> '.$_get["kat"] :"";
?>
<title><?php echo 'Dynamisches Menü mit PHP und Arrays ( '.$view.$kat.' ) - '.$_server['HTTP_HOST']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
* {
}
h1
{
font-size:18px;
}
ul
{
width:10em;
}
li
{
margin : 0;
padding : 0;
list-style-type:none;
background:#CCCCCC none repeat scroll 0 0;
border:1px solid gray;
cursor:pointer;
font-weight:bold;
height:20px;
line-height:20px;
margin:2px 0;
text-align:center;
color:gray;
}
.active
{
margin : 0;
padding : 0;
list-style-type:none;
background:#CCCCCC none repeat scroll 0 0;
border:2px solid red;
cursor:pointer;
font-weight:bold;
height:20px;
line-height:20px;
margin:2px 0;
text-align:center;
}
.inactive
{
color:gray;
}
</style>
</head>
<body>
<?php
$navigation = array
(
"Menü Punkt 1" => array (
"Punkt 1.1" => 'uPunkt 1.1.php',
"Punkt 1.2" => 'uPunkt 1.2.php',
),
"Menü Punkt 2" => array (
"Punkt 2.1" => 'uPunkt 2.1.php',
"Punkt 2.2" => 'uPunkt 2.2.php',
),
"Menü Punkt 3" => array (
"Punkt 3.1" => 'uPunkt 3.1.php',
"Punkt 3.2" => 'uPunkt 3.2.php',
)
);
$navi="";
$current_page=(isset($_GET["view"]))? $_GET["view"]:"";
foreach ($navigation as $key => $value)
{
if($key != $current_page)
{
$navi.=' <li><a href="?view='.$key.'">'.$key.'</a></li>'."\n";
}
else
{
$navi.=' <li class="active"><b>'.$key.'</b></li>'."\n";
$current_kapitel=(isset($_GET["kat"]))? $_GET["kat"]:"";
foreach($value AS $key=>$value)
{
if($key != $current_kapitel)
{
$navi.=' <li><a href="?view='.$current_page.'&kat='.$key.'">'.$key.'</a></li>'."\n";
}
else
{
$navi.=' <li class="active">'.$key.'</li>'."\n";
if (is_file($value))
{
include($value);
}
}
}
}
}
echo "<ul>\n".$navi."</ul>\n"; // Manü ausgeben
?>
</body>
</html>
was du suchst ist ein meü, entweder in css oder ein java-script menü
irgend wo hier im forum fliegen ein haufen solcher menüs herum, ich habe hier eines in php, das mir ganz gut gefallen hatte, habe mir den code mal kopiert.
PHP:<?php error_reporting(e_all | e_strict); if (!headers_sent()) { header("Content-Type: text/html; charset=utf-8"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"> <head> <?php $view=(isset($_get["view"]))? $_get["view"]:""; $kat =(isset($_get["kat"]))?' -> '.$_get["kat"] :""; ?> <title><?php echo 'Dynamisches Menü mit PHP und Arrays ( '.$view.$kat.' ) - '.$_server['HTTP_HOST']; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> * { } h1 { font-size:18px; } ul { width:10em; } li { margin : 0; padding : 0; list-style-type:none; background:#CCCCCC none repeat scroll 0 0; border:1px solid gray; cursor:pointer; font-weight:bold; height:20px; line-height:20px; margin:2px 0; text-align:center; color:gray; } .active { margin : 0; padding : 0; list-style-type:none; background:#CCCCCC none repeat scroll 0 0; border:2px solid red; cursor:pointer; font-weight:bold; height:20px; line-height:20px; margin:2px 0; text-align:center; } .inactive { color:gray; } </style> </head> <body> <?php $navigation = array ( "Menü Punkt 1" => array ( "Punkt 1.1" => 'uPunkt 1.1.php', "Punkt 1.2" => 'uPunkt 1.2.php', ), "Menü Punkt 2" => array ( "Punkt 2.1" => 'uPunkt 2.1.php', "Punkt 2.2" => 'uPunkt 2.2.php', ), "Menü Punkt 3" => array ( "Punkt 3.1" => 'uPunkt 3.1.php', "Punkt 3.2" => 'uPunkt 3.2.php', ) ); $navi=""; $current_page=(isset($_GET["view"]))? $_GET["view"]:""; foreach ($navigation as $key => $value) { if($key != $current_page) { $navi.=' <li><a href="?view='.$key.'">'.$key.'</a></li>'."\n"; } else { $navi.=' <li class="active"><b>'.$key.'</b></li>'."\n"; $current_kapitel=(isset($_GET["kat"]))? $_GET["kat"]:""; foreach($value AS $key=>$value) { if($key != $current_kapitel) { $navi.=' <li><a href="?view='.$current_page.'&kat='.$key.'">'.$key.'</a></li>'."\n"; } else { $navi.=' <li class="active">'.$key.'</li>'."\n"; if (is_file($value)) { include($value); } } } } } echo "<ul>\n".$navi."</ul>\n"; // Manü ausgeben ?> </body> </html>