#!/bin/sh

# CGI Framework für einfache POST und GET-Funktionen
# sudo git clone https://git.plutz.net/git/cgilite /opt/cgilite
. /opt/cgilite/cgilite.sh

echo "Content-Type: text/html; charset=utf-8"
echo

cat <<HTML_ENDE
<!DOCTYPE HTML>
<html lang="de"><head>
  <title>Hallo Welt!</title>
</head><body>
  <form action="/hallo.sh" method="POST">
	Sei gegrüßt $(POST nf) $(POST nl)!<br/>
    <h1>Hallo Programm</h1>
    <input type="text" placeholder="Vorname"  name="nf">
	<input type="text" placeholder="Nachname" name="nl">
    <input type="submit">
	<h2>Letztes Aufrufdatum:</h2>
	$(date)
	<h2>Webserver Umgebungsvariablen</h2>
	<pre>$(env)</pre>
  </form>
</body></html>
HTML_ENDE