#!/bin/csh -f

echo "Content-type: text/html"
echo ""
echo '<html><title>1000 Points of Light</title><body bgcolor="101010" text=white>\
<center><applet code=draw.class width=250 height=365>'

set LAST = `tail --lines 1 /home/chingon/db/kpts.dat`
set SUBMITTED = `tail --lines 1 /home/chingon/db/kpts_host.dat | grep -c $REMOTE_HOST`

# make sure the QUERY_STRING contains lots of comma separated #s
if( `echo $QUERY_STRING | tr "," " " | wc -w` > 156 ) then
		echo $QUERY_STRING >> /home/chingon/db/kpts.dat
	 	echo $REMOTE_HOST >> /home/chingon/db/kpts_host.dat
endif

echo '<param name=DATA value="'$LAST'">'
echo '<param name=SUB value="'$SUBMITTED'">'
echo '</center></applet></html>'
