#!/bin/sh # this is a script for adding a new tourist attraction # the data from the form is taken from stdin PATH=.:/opt/jdk1.2.1/bin:/home/pjbrown/bin:/usr/java/bin:/usr/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/jdk/bin:/usr/X11R6/bin:/usr/local/jdk/bin:$PATH export PATH echo "Content-type: text/html" echo # redirect stderr to stdout exec 2>&1 RAW_FORM=`cat` echo "" FORM=`echo $RAW_FORM | sed ' s/%2c/,/g s/%2C/,/g s/+/ /g s/%2b/+/g s/%2B/+/g s/\\&/\ /g s/CM_/ /g #s/X=// #s/Y=/ / #s/THRESHOLD=/ / '` echo '
" echo "" echo "
Note that this is a prototype version that does not currently offer data checking, or a facility for you to change the data later."
# now add to data base
# check-fields converts to 7 digit OS co-ords
DATABASE=/home/pjbrown/tourist_database/t_attractions.notes
SCRIPT_DIR=/home/pjbrown/w/CAR_share_copy/Xamples
# set HOST (so that, e.g., ml1 works)
# special set up because HOSTTYPE is not set on apache at exeter
if test x"$SERVER_NAME" = x"www.dcs.ex.ac.uk"; then
HOSTTYPE=sun4; export HOSTTYPE
fi
#
cd $SCRIPT_DIR
echo ' Thank you for your entry; it has been added to the database"
echo ""