From: Justin T. <jus...@ar...> - 2005-11-23 17:39:01
|
GET is pretty simple. The query string will be stored in an environment variable $QUERY_STRING POST is a bit more work however. When they post data using the POST method, $CONTENT_LENGTH will contain the length of the post data. You must read the data from standard in... heres 1 way to do it: QUERY_STRING="`/bin/dd count=$CONTENT_LENGTH bs=1`"; Then, if you want to seperate the key/value pairs and store them in environment variables, you can use my shell functions below: url_decode() { ret=`echo $1 | sed -e 's/+/ /g; s/%/\\\x/g'`; echo -e "$ret"; } # # Parses GET url variables and stores them as WWW_varname # function parsevars () { VAR_PREFIX=WWW_ for var in `echo $1 | sed -e 's/&/ /g'` do key=`echo $var | awk -F= '{print $1;}'`; val=`echo $var | awk -F= '{print $2;}'`; export ${VAR_PREFIX}${key}="`url_decode $val`"; done } ----- Original Message ----- From: "Craig Hughes" <cr...@gu...> To: <gum...@li...> Sent: Wednesday, November 23, 2005 9:23 AM Subject: Re: [Gumstix-users] writing dynamic webpages with boa > Doh, yup. Forgot about that -- too much scotch before replying to > questions leads to unoptimal answers. > > C > > On Nov 23, 2005, at 4:58 AM, Colin Sauze wrote: > >> POST is sent as standard input > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.362 / Virus Database: 267.13.7/180 - Release Date: 11/23/2005 > > |