ben_s WebLog Script No 1
2010-11-01
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WebLog Script No 1</title>
<link rel="stylesheet" type="text/css" href="weblog.css">
</head>
<body>
<div class="content">
<img src="mein_liebes.jpg" width=460 height=100 border="0"><br>
<img src="weblog.jpg" width=460 height=100 border="0"><br>
<?php
if ($schreiben == "jaBitte"){
print "<hr noshade color=\"#808080\">";
echo "<div id=\"back1\"><form method=\"POST\" action=\"weblog.php3\">
Titel :<textarea rows=\"1\" name=\"titel\" cols=\"55\"></textarea><br><br>
Text :<textarea rows=\"10\" name=\"text\" cols=\"55\"></textarea><br><br>
<input type=\"submit\" value=\"OK\" name=\"ok\">
<input type=\"reset\" value=\"Abbrechen\" name=\"loeschen\">
</form></div>";
}
if ($text != ""){
$hol = time();
$zeit = gmdate("d.m.Y - H.i", $hol);
$temp = fopen("temp.txt", "a+");
fwrite ($temp, "<h3>");
fwrite ($temp, $titel);
fwrite ($temp, "</h3>\\n");
fwrite ($temp, "<p class='artikel'>\\n");
fwrite ($temp, $text);
fwrite ($temp, "</p>\\n");
fwrite ($temp, "<p>[");
fwrite ($temp, $zeit);
fwrite ($temp, "]\n</p><br>\n\\n" );
$weblog = fopen("weblog.txt", "r") or die ("Kann Datei nicht lesen.");
while ($line = fgets($weblog, 1024)):
fwrite ($temp, $line);
endwhile;
fclose($weblog);
fclose($temp);
unlink("weblog.txt");
rename ("temp.txt", "weblog.txt");
}
include ("weblog.txt");
?>
</div>
</body>
</html>