[mapserver-users] CGI variable substitution
Paul Spencer
pspencer at dmsolutions.ca
Wed May 28 19:14:04 PDT 2008
Not sure if this is related, but I am surprised that your example
works because you have not escaped the = in your pfilter. I would
have expected that pfilter would have been cut off just before
client_id and you would have a new variable called client_id=70))
Paul
On 28-May-08, at 9:51 PM, Stephen Davies wrote:
> I have been using variable substitution for ages without any
> problems at all
> but now need to make a change to add a new variable.
>
> I just cannot make it work.
> Presumably, I am doing something stupid but I cannot see what.
> Can anybody please help.
>
> My URL looks like this:
> http://www.agua.com.au/benparts/map.html?map=/tmp/11_70.map&client=70&mapext=140.5261724+-36.7067416+140.5485957+-36.6984975
> &mre=-1296538.11+-4230140.65+62672.87+-2872042.86&pfilter=pid+in+
> (select+probe.id+from+probe+where+logger_id+in+(select+id+from+logger
> +where+client_id=70))
>
> (plus a deal more filter definitions).
>
> My map file looks like this:
>
> LAYER
> CONNECTIONTYPE postgis
> NAME "probe"
> DATA "geom from atp using unique id using SRID=4283"
> CONNECTION "user=scldad dbname=benparts"
> PROCESSING "CLOSE_CONNECTION=DEFER"
> STATUS ON
> TYPE POINT
> FILTER (%pfilter%)
> PROJECTION
> "init=epsg:4283"
> END
> MAXSCALE 5000000
> LABELITEM "temp"
> CLASS
> NAME "Air Temp (Right Click to select)"
> STYLE
> COLOR 255 255 0
> SYMBOL 'circle'
> SIZE 7
> END
> LABEL
> MINDISTANCE 15
> POSITION CR
> SIZE SMALL
> BACKGROUNDCOLOR 0 0 0
> COLOR 255 255 0
> FORCE TRUE
> END
> END
> END
>
> This works as I expect.
>
> I now want to add a new filter by adding:
>
> &ffilter=blah_blah to the URL
>
> and a new layer with the same syntax as above (but with the new
> filter) to the
> map file.
>
> Despite trying a number of variations on the theme, my PostgreSQL
> log still
> shows a generated command that included %ffilter% instead of the
> substitution
> value.
>
> TIA,
> Stephen Davies
> --
> =
> =
> ======================================================================
> This email is for the person(s) identified above, and is
> confidential to
> the sender and the person(s). No one else is authorised to use or
> disseminate this email or its contents.
>
> Stephen Davies Consulting Voice: 08-8177
> 1595
> Adelaide, South Australia. Fax: 08-8177
> 0133
> Computing & Network solutions. Mobile:0403
> 0405 83
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
__________________________________________
Paul Spencer
Chief Technology Officer
DM Solutions Group Inc
http://www.dmsolutions.ca/
More information about the MapServer-users
mailing list