Using CGI variables in map files

Chip Taylor work at XWB.COM
Thu Oct 20 06:14:13 PDT 2005


The documentation of Mapserver says this:

Variables can be substituted within MapFile parameter values. At this time,
cookie and CGI parameter values are supported. This allows MapServer
MapFiles to be aware of a user's cookies (good for implementing security),
or non-MapServer request parameters (good for integrating with other
systems).

	Syntax: '%' + variable name + '%'

But the examples are not clear.  If I want to pass in a CGI variable, such
as [mapx] and [mapy], into a data statement to select from a postGIS
database; such as:

CONNECTIONTYPE postgis

  CONNECTION "user=auser dbname=mydb host=myserver"

  STATUS ON

  DATA "counties from states where thislon = %mapx% and thislat = %mapy%"

Does not seem to work.  Help?


Chip Taylor

Prepared Response, Inc. 
1127 Broadway Plaza, Suite 204
Tacoma, WA  98402
O 253.272.1730
M 253.948.2525

STATEMENT OF CONFIDENTIALITY
The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify Prepared Response, Inc. immediately at (206)
223-5544 and destroy all copies of this message and any attachments.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051020/cebc56f6/attachment.htm>


More information about the MapServer-users mailing list