#!/usr/local/etc/httpd/querysh #?/bin/sh # test-qsh - print out a form's fields, and the original query (if possible) # - uses querysh to parse input from GET or POST query if [ -z "$QSH_Fields" ] then # No form fields given -- send empty form cat < Querysh Test Form

Querysh Test Form


Sample of an e-mail feedback form

Note:
Please enter all of the information, then use the Submit button at the bottom of the page.

Type :
Comment
Suggestion
Help!

Name (optional) :

Email (should you want a reply; also optional) :

Comments :

! exit fi cat < Querysh Parse Results

Querysh Test Results


!
(
case "$REQUEST_METHOD" in
GET)	echo "GET query:" ; echo "$QUERY_STRING" ;;
POST)	echo "POST query not available to script." ;;
*)	echo "Unknown REQUEST_METHOD: $REQUEST_METHOD" ;;
esac

echo
echo "Querysh variables:"
echo "QSH_Fields=$QSH_Fields" 
for f in $QSH_Fields; do
	eval echo "$f=\"\$$f\""
done
) | sed \
	-e 's/\&/\&/g' \
	-e 's//\>/g' \
	-e 's/"/\"/g'
cat <


!