<html><head></head><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1550119469217_155341">Hi,</div><div><br></div><div>I hope this makes sense...</div><div><br></div><div id="yui_3_16_0_ym19_1_1550119469217_155286" dir="ltr">I'm using simple shell CGI scripts to avoid passing the mapfile name in the service URL, eg:</div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155630"><br></div><div>http://..../cgi-bin/species       with the species CGI script containing:</div><div id="yui_3_16_0_ym19_1_1550119469217_155309" dir="ltr"> <i id="yui_3_16_0_ym19_1_1550119469217_155378"><br></i></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155724"><i id="yui_3_16_0_ym19_1_1550119469217_155378">#!/bin/bash<br id="yui_3_16_0_ym19_1_1550119469217_155358">export MS_MAPFILE=/usr/lib/cgi-bin/mapfiles/species_enhancedsearch.map<br id="yui_3_16_0_ym19_1_1550119469217_155361">/usr/lib/cgi-bin/mapserv</i></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155377"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155560">I can use this approach to get the value of the variable passed in the URL:</div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155555"><i id="yui_3_16_0_ym19_1_1550119469217_155588">species_code=`echo "$QUERY_STRING" | sed -n 's/^.*species_code=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`</i><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155553"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155432">If I have a mapfile which uses runtime substitution to set a value in an SQL in the DATA statement:</div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155431"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155410"><i id="yui_3_16_0_ym19_1_1550119469217_155569">... where c.species='%species_code%' ...</i></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155536"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155537">How do I pass this value to mapserver from the obfuscating script?</div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155746"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155747"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155755">Thanks,</div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155756"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1550119469217_155757">   Brent Wood<br></div></div></body></html>