Finaly I figured out how to get it working; in my php mapscript file I added
the next code:

if ($_GET['mode'] == 'itemquerymap') {
 $qstring = explode("=",$_GET['qstring']);
 
$map->getLayerByName($_GET['qlayer'])->queryByAttributes($qstring[0],str_replace("\\","",$_GET['qstring']),MS_SINGLE);
  // I remove the \ characters of the qstring
}

And at the end of my file:

if ($_GET['mode'] == 'itemquerymap') {
   $image=$map->drawQuery();
} else {
   $image=$map->draw();
}

So if the mode is itemquerymap I draw the query; otherwise I make a normal
draw.

Rodrigo.

On 8/3/07, Rodrigo Martín LÓPEZ GREGORIO <[EMAIL PROTECTED]> wrote:
>
> Hi List.
>
> Normally I use mapserver as CGI, but now I need to move to PHP/mapscript.
> In my actual applet I use the CGI mode=itemquerymap to show the selected
> polygon on a layer with different color. So I pass the next values on the
> CGI call:
>
> mode=itemquerymap&qlayer=mylayer&qstring=someattribute='avalue'
>
> This works greats through CGI. Now I want to get the same effect using PHP
> Mapscript but I'm a little confused how to get it working. I know how to get
> the string parameters in php, even split the qstring parameter using explode
> but what I don't know is what must I do to get PHP Mapscript use the
> QUERYMAP format (defined in my base mapfile) to show the selected polygon.
>
> Can anyone give me a hint?
>
> Thanks.
>
> Rodrigo.
>

Reply via email to