Hi, try $mylayer->setfilter($wdata);
the documentation for mapscript is here: http://mapserver.org/mapscript/index.html#mapscript Thomas Salvator*eL*arosa a écrit : > > Ernesto Barrera wrote: > >> >> Hi Salvatore, >> >> This is not exactly the same case but it might help.... >> >> My "MAPFILE" has a raster layer named 'landuse': >> >> LAYER >> NAME landuse >> TYPE RASTER >> DATA "file01.tif" >> END >> >> and I was interested in giving the user the capability to change the >> data source (i.e. switch from "file01.tif" to "file02.tif", by clicking >> on a button). >> >> To do that, I passed the filename as a variable (wdata) in the URL and >> used the mapscript function "set" to update the layer in the map object: >> >> #### globals.php ############################### >> $wdata=$_REQUEST['wdata']; >> if ($wdata != '') { >> $mylayer=$map->getLayerByName('landuse'); >> $mylayer->set("data",$wdata); >> } >> ############################################# >> >> Maybe is not that clean but it works nicely. >> >> Regards >> >> >> >> >> >> >> >> > > Thank you very much! > > I found this very useful! > > but now I have this problem: > in the same way I would set "filter" instead of "DATA" but give me the > error: > > Fatal error: Property 'FILTER' does not exist in this object. in > C:\ms4w\Apache\htdocs\sicmed\incphp\globals.php on line 67 > > my code is: > > $wdata = 'aree ="' .$_COOKIE['nome_visitatore'].'"'; > //$wdata= 'the_geom from bacini where aree = "' > .$_COOKIE['nome_visitatore'].'"'; > if ($wdata != '') { > $mylayer=$map->getLayerByName('bacini'); > $mylayer->set("filter",$wdata); > > } > > my mapfile is: > > CONNECTIONTYPE POSTGIS > CONNECTION "host=localhost dbname=cms user=postgres password=***** > port=5432" > DATA "the_geom FROM bacini" > FILTER "aree = ''" > > it's possible????? > > > Thanks! > > > ----- > Salvatore Larosa > GPG: 0xE504BBE2 (FP: D9B2 CA87 81CD 1B91 E24D 3B42 D0F7 FA01 E504 BBE2) > ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users