added contact form including PHP script (which is yet untested)

This commit is contained in:
eclipse 2025-02-20 22:20:07 +01:00
parent 0c6c836ebd
commit 75f5f8761c
4 changed files with 95 additions and 12 deletions

49
content/pages/danke.md Normal file
View File

@ -0,0 +1,49 @@
---
title: Nachricht versandt
date: 2025-02-04 10:20
author: Tobias Radloff
summary: Danke für deine Nachricht.
lang: de
slug: danke
save_as: kontakt/danke/index.html
url: kontakt/danke/
---
Danke für deine Nachricht. Ich antworte bestimmt bald. Und bis es soweit ist, kannst du dich an diesem Gedicht von mir erfreuen :-)
## Handwerk
Dichter, Autor, Mann der Worte
so werd ich genannt
doch nicht nur mein Geist ist fleißig,
nein, auch meine Hand.
Vor Schmutz unter den Fingernägeln
schreck ich nicht zurück
ein echter Mann wie ich, der hat
handwerkliches Geschick.
Ich freu mich, wenn es gilt, ein Löch-
lein in die Wand zu bohr'n
denn jedes Mal treff ich mit Verve
genau ins Wasserrohr.
Die Muttern an den Autorädern
zieh ich selber nach
klemm' mir dabei den Ischias
und lieg' drei Wochen flach.
Ich bau IKEA-Möbel auf
die Schwerkraft baut sie ab
beim Umzug helf ich freudig mit
und mach als erster schlapp.
Die Waschmaschine ist kaputt?
Ich kümmere mich drum
wofür, wenn nicht für Wasserschäden,
gibt's Versicherung'n?
Doch neuerdings werd ich nicht mehr
gefragt in Handwerksfragen
So bleibt mir nur ein Handwerk noch:
Gedichte aufzusagen.

View File

@ -1,21 +1,12 @@
---
title: Newsletter und Kontaktformular
title: Kontaktformular
date: 2025-02-04 10:20
slug: newsletter-und-kontaktformular
author: Tobias Radloff
summary: Melde dich für meinen Newsletter an oder schreib mir eine Nachricht.
summary: Schreib mir eine Nachricht.
lang: de
template: contact
slug: kontakt
save_as: kontakt/index.html
url: kontakt/
---
Et vero nihil eum vel alias. Nesciunt qui repudiandae quia qui sint non. Repudiandae facilis eos inventore nisi deserunt maxime distinctio nihil. Iusto autem eveniet in fugit voluptatem. Nemo ut quo quisquam. Ducimus et et est qui aperiam ex.
Quos voluptatem et accusantium necessitatibus optio et. Non fugiat velit aliquid minus pariatur. Fuga exercitationem id nobis et aspernatur ad.
Quibusdam omnis tempore voluptas possimus est nesciunt occaecati est. Voluptatum dignissimos excepturi et ab tempore amet. Quia necessitatibus dolor vero voluptatibus et eum. Ut vel dolor laboriosam incidunt dolorem nisi error. Delectus at expedita eaque architecto. Expedita quae reprehenderit quisquam hic ut exercitationem.
Minima quia saepe culpa. Qui nisi ut magnam expedita assumenda earum et nobis. Vitae saepe aperiam vel. Assumenda dicta perspiciatis iure nihil assumenda. Distinctio dolorem explicabo dolores enim sit rem et.
Perspiciatis nam ipsam doloremque incidunt veritatis. Ducimus voluptatem eius odit eveniet voluptatibus. Laborum et quia vero necessitatibus sequi.

18
theme/static/contact.php Normal file
View File

@ -0,0 +1,18 @@
<?php
//source: https://www.unixdude.net/posts/2017/Nov/29/pelican-contact-form/
if(isset($_POST['address']) && $_POST['address'] == ''){
//The form was submitted
$ouremail = 'kontakt@tobias-radloff.de';
// Important: if we add any form fields to the HTML,
// and want them included in the email, we will need to add them here also
$body = "Diese Nachricht wurde soeben durch das Kontaktformular auf t-r.de übermittelt:
Name: $_POST[name]
Emailadresse: $_POST[email]
Nachricht: $_POST[nachricht]";
// From:
$headers = "From: $_POST[email]";
// send the message
mail($ouremail, 'Nachricht ueber das Kontaktformular von t-r.de!', $body, $headers );
header('Location: /kontakt/danke/');
}
?>

View File

@ -0,0 +1,25 @@
{% extends "page.html" %}
{% block content_body %}
<form id="contact-form" method="post" action="/theme/static/contact.php">
<fieldset>
<label>
Name
<input name="name" placeholder="Name" autocomplete="given-name" aria-label="Name" required/>
</label>
<label>
Email
<input type="email" name="email" placeholder="Emailadresse" autocomplete="email" aria-label="Emailadresse" required/>
</label>
<label id="leave-empty">
Leave this empty
<input name="address" placeholder="Anschrift" autocomplete="address" />
</label>
<label>
Nachricht
<textarea name="nachricht" placeholder="Deine Nachricht" aria-label="Nachricht" rows="5" required></textarea>
</label>
<input type="submit" value="Nachricht senden" />
<input type="reset" value="Zurücksetzen" />
</fieldset>
</form>
{% endblock content_body %}