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.
...
<title>
<?php
$array = file("page/title.txt");
if ($_GET['page'] == "start")
{ echo $array[2]; }
if ($_GET['page'] == "impressum")
{ echo $array[5]; }
if ($_GET['page'] == "demos")
{ echo $array[8]; }
if ($_GET['page'] == "programme")
{ echo $array[11]; }
if ($_GET['page'] == "flash")
{ echo $array[14]; }
if ($_GET['page'] == "homebrew")
{ echo $array[17]; }
if ($_GET['page'] == "themes")
{ echo $array[20]; }
if ($_GET['page'] == "wallpaper")
{ echo $array[23]; }
?>
</title>
...
...
<div id="content">
<?php
if (! isset($_GET["page"]))
{ $_GET["page"] = "start"; }
if ($_GET['page'] == "start")
{ include "page/start.html"; }
if ($_GET['page'] == "impressum")
{ include "page/impressum.html"; }
if ($_GET['page'] == "demos")
{ include "page/demos.html"; }
if ($_GET['page'] == "programme")
{ include "page/programme.html"; }
if ($_GET['page'] == "flash")
{ include "page/flash.html"; }
if ($_GET['page'] == "homebrew")
{ include "page/homebrew.html"; }
if ($_GET['page'] == "themes")
{ include "page/themes.html"; }
if ($_GET['page'] == "wallpaper")
{ include "page/wallpaper.html"; }
?>
</div>
...
Mit "funktioniert nicht" meine ich, dass die Titel der Unterseiten nicht entsprechend angezeigt werden.Keine Ahnung warum es bei Dir nicht funktioniert, weil Du auch nicht schreibst, was nicht funktioniert?
Ein kleiner Tipp, der ja vielleicht schon hilft: $array beginnt mit dem Index 0.
Gruß thuemmy
Hmm, und wie kann ich den $array "ausgeben"? Hab schon gesucht und alles mögliche gefunden, was mir allerdings nicht helfen konnte.Lass Dir halt mal $array ausgeben, ob das File überhaupt richtig eingelesen wird.
<?php
print_r($array);
// oder auch
var_dump($array);
// oder auch
foreach($array as $element) {
echo $element . "<br>\n";
}
// aber auch so
$count = count(array);
for ($i=0;$i<$count;$i++) {
echo "Zeile " . $i+1 . ": " . $array($i) . "<br>\n";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>
<?php
array = file("page/title.txt");
print_r ($array);
if ($_GET['page'] == "start")
{ echo $array[0]; }
if ($_GET['page'] == "impressum")
{ echo $array[1]; }
if ($_GET['page'] == "demos")
{ echo $array[2]; }
if ($_GET['page'] == "programme")
{ echo $array[3]; }
if ($_GET['page'] == "flash")
{ echo $array[4]; }
if ($_GET['page'] == "homebrew")
{ echo $array[5]; }
if ($_GET['page'] == "themes")
{ echo $array[6]; }
if ($_GET['page'] == "wallpaper")
{ echo $array[7]; }
?>
</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="standard.css">
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="lt_ie7.css">
<![endif]-->
</head>
<body>
...
</body>
</html>
<html>
<head>
<title>
<?php
array = file("page/title.txt");
print_r($array);
if ($_GET['page'] == "start")
{ echo $array[0]; }
?>
</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="standard.css">
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="lt_ie7.css">
<![endif]-->
</head>
<body>
...
</body>
</html>
<html>
<head>
<title>
<?php
array = file("page/title.txt");
if ($_GET['page'] == "start")
{ echo $array[0]; }
?>
</title>
...
...
<body>
<?php
print_r($array);
print_r($_GET);
?>
</body>
</html>
<html>
<head>
<?php
print_r($array);
print_r($_GET);
?>
<title>
<?php
$array = file("page/title.txt");
if ($_GET['page'] == "start")
{ echo $array[0]; }
if ($_GET['page'] == "impressum")
{ echo $array[1]; }
if ($_GET['page'] == "demos")
{ echo $array[2]; }
if ($_GET['page'] == "programme")
{ echo $array[3]; }
if ($_GET['page'] == "flash")
{ echo $array[4]; }
if ($_GET['page'] == "homebrew")
{ echo $array[5]; }
if ($_GET['page'] == "themes")
{ echo $array[6]; }
if ($_GET['page'] == "wallpaper")
{ echo $array[7]; }
?>
</title>
...