mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-24 10:41:56 +01:00
58 lines
1.3 KiB
PHP
58 lines
1.3 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);
|
|||
|
$empfaenger = "IhrName@IhrServer";
|
|||
|
$betreff = "Neuer G<>stebucheintrag";
|
|||
|
$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);
|
|||
|
mail ($empfaenger, $betreff, $Kommentar, "From: $Name <$Email>");
|
|||
|
$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>
|