[mapserver-users] Cannot pass variable with php MapScript to the Mapfile

John Beck beckjoh at knology.net
Sun Jul 6 15:26:17 EDT 2008


I have an application in which I pass a variable %table%  thru the url to the Mapserver mapfile and it works great.

My example

LAYER
CONNECTION "<OGRVRTDataSource>
<OGRVRTLayer name='data'>
<SrcDataSource>MYSQL:xxxx,user=xxxx,password=xxxxx,port=3306,tables=%table%</SrcDataSource> 
<SrcSQL>SELECT * FROM %table%</SrcSQL> 
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>WGS84</LayerSRS>
<GeometryField encoding='PointFromColumns' x='Long' y='Lat'/> 
</OGRVRTLayer>
</OGRVRTDataSource>"
CONNECTIONTYPE OGR 

But now I am trying to use mapscript to print the map and when I call

$image = $mapfile->draw()

I get errors wanting to know the value of %table%

How do I implement this function when using PHP/Mapscript.  When creating a new MapObj and drawing the map,
url-parameters or cookies appear not to be passed to the mapserver. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080706/55b19333/attachment.html


More information about the mapserver-users mailing list