One way to do it is to pass new parameters(with tha exact name of you're mapfile variable) in the GetFeatureInfo URL so it would look something like this:<div><br></div><div><font size="2" face="sans-serif">Here is the request</font><font size="3"> </font><font size="2" face="sans-serif">GetFeatureInfo<br>
/cgi-bin/mapserv.exe?map=MYMAP service=WMS&version=1.1.0&request=GetFeatureInfo&layers=ecoles&query_layers=ecoles&styles=&bbox=-8820221.560815%2C5721770.182129%2C-7587445.168853%2C6361395.234705&srs=EPSG%3A900913&feature_count=3000&x=272&y=457&height=523&width=1008&info_format=text%2Fhtml<b>&</b></font><span class="Apple-style-span" style="font-family: sans-serif; "><b>SEMCDC=<value>&</b></span><span class="Apple-style-span" style="font-family: sans-serif; "><b>RSS=</b></span><span class="Apple-style-span" style="font-family: sans-serif; "><b><value>&</b></span><span class="Apple-style-span" style="font-family: sans-serif; "><b>ORDRE</b></span><span class="Apple-style-span" style="font-family: sans-serif; "><b><value></b></span><br>
<br></div><div>MapServer will then replace the value before returning the result.</div><div><br></div><div>hope's this help....</div><div><br></div><div>MartinO</div><div><br><div class="gmail_quote">2009/11/23 <span dir="ltr"><<a href="mailto:Steve.Toutant@inspq.qc.ca">Steve.Toutant@inspq.qc.ca</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><font size="2" face="sans-serif">Hi,</font><font size="3"> </font>
<br><font size="2" face="sans-serif">I already posted this problem on openlayers
list, but it might be a mapserver issue.</font>
<br>
<br><font size="2" face="sans-serif">OpenLayers.Control.WMSGetFeatureInfo
doesn't use the FILTER key in my mapfile. This filter is define with variables
like this:</font>
<br><font size="2" face="sans-serif">FILTER "semcdc in (%SEMCDC%) and
rss in (%RSS%) and ordre in (%ORDRE%)"</font><font size="3"> </font><font size="2" face="sans-serif">.
</font>
<br>
<br><font size="2" face="sans-serif">The getMap request is succesfull but
not the GetFeatureInfo request<br>
<br>
Here is the request</font><font size="3"> </font><font size="2" face="sans-serif">GetFeatureInfo<br>
/cgi-bin/mapserv.exe?map=MYMAP service=WMS&version=1.1.0&request=GetFeatureInfo&layers=ecoles&query_layers=ecoles&styles=&bbox=-8820221.560815%2C5721770.182129%2C-7587445.168853%2C6361395.234705&srs=EPSG%3A900913&feature_count=3000&x=272&y=457&height=523&width=1008&info_format=text%2Fhtml</font><font size="3">
<br>
</font><font size="2" face="sans-serif"><br>
Here is the response</font><font size="3"> </font><font size="2" face="sans-serif"><br>
<?xml version='1.0' encoding="ISO-8859-1" standalone="no"
?></font><font size="3"> </font><font size="2" face="sans-serif"><br>
<!DOCTYPE ServiceExceptionReport SYSTEM "<a href="http://schemas.opengis.net/wms/1.1.0/exception_1_1_0.dtd" target="_blank">http://schemas.opengis.net/wms/1.1.0/exception_1_1_0.dtd</a>"></font><font size="3">
</font><font size="2" face="sans-serif"><br>
<ServiceExceptionReport version="1.1.0"></font><font size="3">
</font><font size="2" face="sans-serif"><br>
<ServiceException></font><font size="3"> </font><font size="2" face="sans-serif"><br>
prepare_database(): Query error. Error declaring cursor: ERROR: syntax
error at or near "%"</font><font size="3"> </font><font size="2" face="sans-serif"><br>
LINE 1: ...:text from ecoles WHERE (semcdc in (%SEMCDC%) ...</font><font size="3">
</font><font size="2" face="sans-serif"><br>
^</font><font size="3">
</font><font size="2" face="sans-serif"><br>
With query string: DECLARE mycursor BINARY CURSOR FOR SELECT "taux_abs"::text,"nouv"::text,asbinary(force_collection(force_2d(geom900913)),'NDR'),id::text
from ecoles WHERE (semcdc in (%SEMCDC%) and rss in (%RSS%) and ordre in
(%ORDRE%)) and (geom900913 && setSRID( 'BOX3D(-8493071.07981319
5795761.22549582,-8480841.15528974 5807991.15001926)'::BOX3D,900913)
)</font><font size="3"> <br>
</font><font size="2" face="sans-serif"><br>
</ServiceException></font><font size="3"> </font><font size="2" face="sans-serif"><br>
</ServiceExceptionReport></font><font size="3"> <br>
<br>
</font><font size="2" face="sans-serif">In OL, I have a WMS layer define
like this:</font><font size="3"> </font><font size="2" face="sans-serif"><br>
new OpenLayers.Layer.WMS('ecoles', '.../cgi-bin/mapserv.exe?map=MYMAP',{layers:
'ecoles', transparent: "true", format:"image/gif",
SEMCDC:thisCDC, RSS: thisRSS, ORDRE: thisOrdre},{isBaseLayer: false, visibility:
false,singleTile:true,transitionEffect: 'resize'});</font><font size="3">
<br>
</font><font size="2" face="sans-serif"><br>
How should I query the layer?</font><font size="3"> </font><font size="2" face="sans-serif"><br>
Thanks</font><font size="3"> </font><font size="2" face="sans-serif"><br>
Steve</font><font size="3"> </font><font size="2" face="sans-serif"><br>
</font><font size="3" color="#0066ff"><i><br>
Steve Toutant, M. Sc.</i></font><font size="3"><br>
Analyste en géomatique<br>
Secteur environnement<br>
Direction de la santé environnementale et de la toxicologie<br>
Institut national de santé publique du Québec<br>
945, avenue Wolfe<br>
Québec, Qc G1V 5B3 </font>
<p><font size="3">Tél.: (418) 650-5115 #5281<br>
Fax.: (418) 654-3144</font><font size="3" color="blue"><u><br>
</u></font><a href="mailto:steve.toutant@inspq.qc.ca" target="_blank"><font size="3" color="blue"><u>steve.toutant@inspq.qc.ca</u></font></a><font size="3" color="blue"><u><br>
</u></font><a href="http://www.inspq.qc.ca/" target="_blank"><font size="3" color="blue"><u>http://www.inspq.qc.ca</u></font></a><font size="3">
</font>
<br>
<br></p><br>_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br></blockquote></div><br></div>