mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-28 04:31:56 +01:00
56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
|
<?php
|
|||
|
function SchreibeDatei ($Email,$Name,$Kommentar)
|
|||
|
{
|
|||
|
# Feldinhalte Email, Name und Kommentar werden in externe Datei geschrieben
|
|||
|
$datei = "gbook.txt";
|
|||
|
$Kommentar = strip_tags ($Kommentar);
|
|||
|
$Kommentar = htmlentities ($Kommentar);
|
|||
|
$Name = htmlentities ($Name);
|
|||
|
$timestamp = time ();
|
|||
|
$datum = date ("d.m.Y",$timestamp);
|
|||
|
$uhrzeit = date ("H:i:s",$timestamp);
|
|||
|
$oeffnen = fopen ($datei, "a");
|
|||
|
if ($Name == "" or $Email == "" or $Kommentar == "")
|
|||
|
{
|
|||
|
echo "Bitte alle Felder ausf<73>llen!<br>";
|
|||
|
}
|
|||
|
else if ($oeffnen)
|
|||
|
{
|
|||
|
fwrite ($oeffnen,
|
|||
|
"<a href=\"mailto:$Email\">$Name</a>\n$Kommentar\nEingetragen am $datum um $uhrzeit Uhr\n<hr>\n");
|
|||
|
fclose ($oeffnen);
|
|||
|
$allesklar = TRUE;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
$allesklar = FALSE;
|
|||
|
}
|
|||
|
return $allesklar;
|
|||
|
}
|
|||
|
# Funktion endet hier
|
|||
|
?>
|
|||
|
|
|||
|
|
|||
|
<html>
|
|||
|
<head>
|
|||
|
<title>G<EFBFBD>stebuch / Chat</title>
|
|||
|
</head>
|
|||
|
<body>
|
|||
|
|
|||
|
<?php
|
|||
|
# R<>ckmeldung f<>r den Benutzer
|
|||
|
$CallFunction = SchreibeDatei ($Email,$Name,$Kommentar);
|
|||
|
if ($CallFunction)
|
|||
|
{
|
|||
|
print ("Danke f<>r den Eintrag");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
print ("Fehler, bitte noch einmal versuchen");
|
|||
|
}
|
|||
|
?>
|
|||
|
|
|||
|
<p>
|
|||
|
<a href="gbook1.php">Zur<EFBFBD>ck / Eintr<EFBFBD>ge lesen</a></p>
|
|||
|
</body>
|
|||
|
</html>
|