run-time substitution is CGI only, see http://mapserver.gis.umn.edu/docs/howto/runsub
In Mapscript there are more flexible ways to achieve this. But you have to program it with Javascript and the Mapscript language. Armin On 13/12/2008 17:45, leandro leandro wrote: > Hello all, > > I´m tring to use mapserver variable substitution ( > http://mapserver.gis.umn.edu/docs/reference/mapfile/variable_sub) and it > works using cgi mapserv but I can't figure out how to use in pmapper. > > Is it possible to pass variables to map file in the url using pmapper? > > For example: I want to pass the variable "newpoint" in the url and use it in > the query string in mysql > > MAP FILE: > LAYER > NAME testpoint > TYPE POINT > STATUS DEFAULT > CONNECTIONTYPE OGR > CONNECTION " > <OGRVRTDataSource> > <OGRVRTLayer name='mydata'> > > > <SrcDataSource>MYSQL:dbname,user=xxxx,password=xxxx,host=localhost,port=3306,tables=position</SrcDataSource> > > <SrcSQL> > select point, lat, lon from position where > point='%newpoint%'; > </SrcSQL> > <GeometryType>wkbPoint</GeometryType> > <GeometryField encoding='PointFromColumns' x='lon' y='lat'/> > </OGRVRTLayer> > </OGRVRTDataSource>" > DATA "mydata" > LABELITEM "point" > ... > END # Layer > > > Using cgi mapserv: > http://localhost/cgi-bin/mapserv.exe?map=mymap.map&mode=map&newpoint=point-test1 > Using pmapper: > http://localhost/pmapper_test/map.phtml?&newpoint=point-test1 > > In pmapper I dont have any error in the logs, the map is drawn (other > layers) but the point is not showed. > > If I put a fixed value in the query string, instead of using variables , it > works ok: > <SrcSQL> > select point, lat, lon from position where > point='point-test1'; > </SrcSQL> > Thanks > Leandro > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > pmapper-users mailing list > pmapper-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pmapper-users > ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users