#!/bin/bash

echo "Content-type: text/html"
echo "" # må ha tom linje mellom HTTP Headers og Body

echo '<html>'
echo '<head>'
echo '<meta charset="utf-8">'
echo '<title>NEVER accept user input directly</title>'
echo '</head>'
echo '<body>'
echo '<h1>User input needs careful handling! Never accept it unseen!</h1>'
echo '<p>'
echo The command was ${QUERY_STRING}. Let\'s run it
echo '</p>'
echo '<pre>'
${QUERY_STRING:-echo}  # user could have typed whatever command
echo '</pre>'
echo '</body>'
echo '</html>'
