| The form data will be passed across in the environment variable $QUERY_STRING
in the form var1=value1&var2=value2 etc.
the values will be escaped so that space turns in + and other characters into
a hex represnetation, so these will need to be decoded. There are routines
avaialble to do this in many languages, including sed scripts which you can
call from the shell.
check out http://hoohoo.ncsa.uiuc.edu/cgi/overview.html for the gory details.
You might like to use the following script to experiment with:
#!/bin/sh
echo Content-type: text/plain
echo
echo CGI/1.0 test script report:
echo
echo argc is $#. argv is "$*".
echo Working directory:
pwd
echo SERVER_SOFTWARE = $SERVER_SOFTWARE
echo SERVER_NAME = $SERVER_NAME
echo GATEWAY_INTERFACE = $GATEWAY_INTERFACE
echo SERVER_PROTOCOL = $SERVER_PROTOCOL
echo SERVER_PORT = $SERVER_PORT
echo REQUEST_METHOD = $REQUEST_METHOD
echo HTTP_ACCEPT = "$HTTP_ACCEPT"
echo PATH_INFO = $PATH_INFO
echo PATH_TRANSLATED = $PATH_TRANSLATED
echo SCRIPT_NAME = $SCRIPT_NAME
echo QUERY_STRING = $QUERY_STRING
echo REMOTE_HOST = $REMOTE_HOST
echo REMOTE_ADDR = $REMOTE_ADDR
echo REMOTE_USER = $REMOTE_USER
echo CONTENT_TYPE = $CONTENT_TYPE
echo CONTENT_LENGTH = $CONTENT_LENGTH
echo HTTP_REFERER = $HTTP_REFERER
echo HTTP_FROM = $HTTP_FROM
echo HTTP_USER_AGENT = $HTTP_USER_AGENT
echo STANDARD INPUT FOLLOWS
cat
echo END OF STANDARD INPUT
|
| I would suggest that you get a copy of 'uncgi' (freeware) and have your
forms feed their input through this. It takes all the fields on your
form and makes them environment variables. In your shell script, you
then work with these environment variables. I use this for all my forms
and it works great.
For example, if your form had this action: "/cgi/formserv.csh" it just
becomes "/cgi/uncgi/formserv.csh".
If your form has a field called 'first_name', uncgi takes the value
from this and puts it into an environment variable called
'$WWW_first_name' which you can manipulate in your shell script.
The most recent version of the uncgi software, is available via the
World-Wide Web at http://www.hyperion.com/~koreth/uncgi.html.
I can send you the README file if you're interested.
/pat
|