Openwrt, access environment variables in CGI script

Save the below content to /www/cgi-bin/test.cgi Then access the URL You should see the environment vars.
These could be used in your script for logic.
You can take it a step further and add parameters to the get request and then parse them out of QUERY_STRING. Something like:
echo "Content-type: text/html"
echo ""
echo "<HTML><HEAD><TITLE>CGI Environment</TITLE></HEAD>"
echo "<BODY>"
echo "<pre>"
echo "</pre>"
echo "</BODY></HTML>"

Discuss on the OpenWrt forums:  Uhttpd environment/CGI variables