[mapserver-users] help passing runtime variables through cgi obfuscation script

Stephen Woodbridge stephenwoodbridge37 at gmail.com
Thu Feb 14 21:37:24 PST 2019


Have your script add the parameters to QUERY_STRING. 

Sent from my iPhone

> On Feb 14, 2019, at 11:19 PM, Brent Wood <pcreso at yahoo.com> wrote:
> 
> Hi,
> 
> I hope this makes sense...
> 
> I'm using simple shell CGI scripts to avoid passing the mapfile name in the service URL, eg:
> 
> http://..../cgi-bin/species       with the species CGI script containing:
> 
> #!/bin/bash
> export MS_MAPFILE=/usr/lib/cgi-bin/mapfiles/species_enhancedsearch.map
> /usr/lib/cgi-bin/mapserv
> 
> I can use this approach to get the value of the variable passed in the URL:
> species_code=`echo "$QUERY_STRING" | sed -n 's/^.*species_code=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`
> 
> If I have a mapfile which uses runtime substitution to set a value in an SQL in the DATA statement:
> 
> ... where c.species='%species_code%' ...
> 
> How do I pass this value to mapserver from the obfuscating script?
> 
> 
> Thanks,
> 
>    Brent Wood
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20190215/582bae45/attachment.html>


More information about the mapserver-users mailing list