derkoelschejung: Komisches Problem

Beitrag lesen

Hallo an Alle,

in meinem Script steht
<?php $titel="Hier der Titel"; include("header.php"); ?>.

Im header.php steht dann mehrmals <?php echo $titel ?>

Nun müsste doch in der header.php überall "Hier ist der Titel" stehen. Aber da ist alles leer.

Weiß jemand woran das liegen könnte?

Gruß, Markus

Hm... ist wirklich komisch; bei mir funktionierts so...

<?php $titel="Hier der Titel"; include("header.php"); ?>

<?php echo $titel ?>
<?php echo $titel ?>
<?php echo $titel ?>
<?php echo $titel ?>
<?php echo $titel ?>
<?php echo $titel ?>

Möchtest Du den Titel als Titel der Website angezeigt haben - dann so:

Inhalt der Datei header.php:
<?php $titel = "Titel der Seite"; ?>

Aufruf als Titel und Titel im Text von seite.php:

<html>
<head>
<?php include("header.php"); ?>
<title><?php echo $titel ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?php echo $titel ?>
<body>
</body>
</html>

so geht´s...

hoffe ich konnte helfen
Gruß´
Tom