#!/bin/sh
echo "Content-Type: text/html"
echo ""
# SHOWDDD2PAGE script
# Variables passed are pagename and accesstype
#
# Displays a page from the /ddd2/ directory
eval `echo $QUERY_STRING | sed -e 's/'"'"'/%27/g' | \
awk 'BEGIN { RS="&"; FS="=" }
$1 ~ /^[a-zA-Z][a-zA-Z0-9_]*$/ {
printf "QS_%s=%c%s%c\n", $1, 39, $2, 39 }' |
sed -e 's/+/ /g' `
# Make an entry in the user-access log file
date +"%d/%m/%y %H:%M:%S: $QS_accesstype: $REMOTE_ADDR" >> ../private/user-access.log
# Show the page they requested
cat ../ddd2/$QS_pagename