Hallo Com,
Ich habe folgendes Problem. Wenn ich Include und eine Datei ausführe dann hat es keine Auswirkung wie z.B mit einer Aufgabe im Buch:
ostersonntag.inc.php
ostersonntag.php
ostersonntag.htm
Ich habe 3 Dateien:
Einmal ostersonntag.htm
Einmal ostersonntag.php
und ostersonntag.inc.php
Die folgenden Codes sind aufgelistet. Wenn ich es jetzt ausführe erscheint nur ein Leeres Feld siehe Bild im Anhang.
____
Wenn ich es ohne Include mache klappt es und es sieht so aus: Siehe Bild im Anhang(2)
Wo liegt das Problem bei dem includen?
Ich habe folgendes Problem. Wenn ich Include und eine Datei ausführe dann hat es keine Auswirkung wie z.B mit einer Aufgabe im Buch:
ostersonntag.inc.php
HTML:
<html>
<head>
<link rel="stylesheet" href="test.css" type="text/css">
<?php
?>
</head>
<body>
<nav>
<div class="title">
<h1>Test</h1>
</div>
<ul class="navigation">
<li><a href="#" class="active">Home</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Login</a></li>
<li><a href="#">Forum</a></li>
<li><a href="#">Blog</a></li>
</ul>
</nav>
<div id="ganzbox">
<ul class="box">
<h2>Ostersonntag</h2>
<p>Bitte geben Sie zwei Jahreszaheln ein<br>und senden Sie das Formular ab:</p>
<form action="ostersonntag.php" method="post">
<p><input name="anfang"> Erste Jahreszahl</p>
<p><input name="ende"> Zweite Jahreszahl</p>
<p><input type="submit"> <input type="reset"></p>
</ul>
</div>
</body>
</html>
ostersonntag.php
PHP:
<html>
<head>
<link rel="stylesheet" href="test.css" type="text/css">
<?php
?>
</head>
<body>
<nav>
<div class="title">
<h1>Test</h1>
</div>
<ul class="navigation">
<li><a href="#" class="active">Home</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Login</a></li>
<li><a href="#">Forum</a></li>
<li><a href="#">Blog</a></li>
</ul>
</nav>
<div id="ganzbox">
<ul class="box">
<?php
function ostersonntag($j, &$t, &$m)
{
// Berechnung des kleinen d
$d = ((15 + floor($j/100) - floor($j/400) - floor((8 * floor($j/100) + 13) / 25)) % 30 + 19 * ($j % 19)) % 30;
// Berechnung des großen D
if ($d==29) $D = 28;
else if ($d == 28 && $j%17 >= 11) $D = 27;
else $D = $d;
// Berechnung des kleinen e
$e = (2*($j%4) + 4 * ($j%7) + 6 * $D + (6 + floor($j/100) - floor($j/400) - 2) % 7) %7;
// Berechnung von Tag und Monat
// RÜCKGABE DER WERTE PER REFERENZ
$m = "03";
$t = 21 + $e + $D + 1;
if($t > 31)
{
$m = "04";
$t = $t - 31;
}
if($t < 10)
$t = "0" . $t;
}
?>
</ul>
</div>
</body>
</html>
ostersonntag.htm
PHP:
<html>
<head>
<link rel="stylesheet" href="test.css" type="text/css">
</head>
<body>
<div class="container">
<div id="ganzbox">
<div class="box">
<h2>Ostersonntag</h2>
<?php
include "ostersonntag.inc.php";
$anfang = $_POST["anfang"];
$ende = $_POST["ende"];
if ($anfang > $ende)
{
$temp = $anfang;
$anfang = $ende;
$ende = $temp;
}
echo "<table border='2'>";
echo "<tr><td><b>Jahr</b></td><td><b>Datum</b></td></tr>";
for ($jahr=$anfang; $jahr<=$ende; $jahr++)
{
ostersonntag($jahr, $tag , $monat);
echo "<tr><td>$jahr</td><td>$tag.$monat.$jahr</td></tr>";
}
echo "</table>";
?>
</div>
</div>
</div>
</form>
</body>
Ich habe 3 Dateien:
Einmal ostersonntag.htm
Einmal ostersonntag.php
und ostersonntag.inc.php
Die folgenden Codes sind aufgelistet. Wenn ich es jetzt ausführe erscheint nur ein Leeres Feld siehe Bild im Anhang.
____
Wenn ich es ohne Include mache klappt es und es sieht so aus: Siehe Bild im Anhang(2)
Wo liegt das Problem bei dem includen?