#!/usr/local/bin/tcsh

echo  "Content-type: text/html\n"

setenv DISPLAY olo:0.0

setenv HOME /home/ripp/wscoperr
set home=$HOME

if ($REQUEST_METHOD == "POST") then 
    setenv QUERY_STRING $<
endif

setenv QUERY_STRING `echo "$QUERY_STRING" | sed -e "s/\*/all/g"`
setenv QUERY_STRING `echo "$QUERY_STRING" | sed -e "s/Science=//" | sed -e "s/Procedure=//"`

if ( ! $?QUERY_STRING || $QUERY_STRING == "" || $QUERY_STRING == "genoret" || $QUERY_STRING == "WelcomeToGenoret" ) then 
    setenv QUERY_STRING "Genoret&WelcomeToGenoret"
endif

set Science=`echo "$QUERY_STRING" | cut -d "&" -f1`
set Commande=`echo "$QUERY_STRING" | cut -d "&" -f2`

setenv QUERY_STRING `echo "$QUERY_STRING" | sed -e "s/+/%20/g"`
setenv QUERY_STRING `echo "$QUERY_STRING" | sed -e "s/%0D/%20/g"`
setenv QUERY_STRING `echo "$QUERY_STRING" | sed -e "s/%0A/%20/g"`

#rR echo "$QUERY_STRING" >> /home/ripp/GenoretServer.log

/home/ripp/wscoperr/cafedessciences/bin/question_de_science $Science HtmlServer QueryFollows $QUERY_STRING

exit


