<br><tt><font size=2>&gt; Not any great hazard, I believe, ...</font></tt>
<br>
<br><font size=2 face="Arial">Mmh. I'd be cautious.</font>
<br>
<br><font size=2 face="Arial">Example:</font>
<br><font size=2 face="Arial">* Mapfile:</font>
<br><font size=2 face="Arial">&nbsp; &nbsp;DATA &quot;the_geom from buildings&quot;<br>
</font>
<br><font size=2 face="Arial">* Set Filter via URL to this:</font>
<br><font size=2 face="Arial">&nbsp; 1=1);DELETE FROM OTHERTABLE; DECLARE
X BINARY CURSOR FOR SELECT * from buildings WHERE (1=1</font>
<br>
<br><font size=2 face="Arial">I think Mapserver will create the following
statements: (I've added newlines)</font>
<br><font size=2 face="Arial">DECLARE mycursor BINARY CURSOR FOR SELECT
the_geom from buildings WHERE (1=1);</font>
<br><font size=2 face="Arial">DELETE FROM OTHERTABLE; </font>
<br><font size=2 face="Arial">DECLARE X BINARY CURSOR FOR SELECT * from
buildings WHERE (1=1) and (%s &amp;&amp; setSRID( ...) )</font>
<br>
<br><font size=2 face="Arial">Mapserver calls PQExec with these statements.
PQExec will execute every statement and will return </font>
<br><font size=2 face="Arial">the results of the last one.</font>
<br>
<br><font size=2 face="Arial">Bye</font>
<br><font size=2 face="Arial">Benedikt Rothe</font>
<br>
<br>
<br><tt><font size=2>&quot;Rahkonen Jukka&quot; &lt;Jukka.Rahkonen@mmmtike.fi&gt;
schrieb am 26.01.2009 09:34:31:<br>
<br>
&gt; Hi,</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; Not any great hazard, I believe, if it means
that user can normally <br>
&gt; get all the features, but only a subset when filter is set. &nbsp;It
is <br>
&gt; different case if DATA clause is manipulated, and therefore that <br>
&gt; must be connected to DATAPATTERN.</font></tt>
<br><tt><font size=2>&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; -Jukka Rahkonen-</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Lähettäjä: mapserver-users-bounces@lists.osgeo.org [mailto:<br>
&gt; mapserver-users-bounces@lists.osgeo.org] Puolesta umn-ms@hydrotec.de<br>
&gt; Lähetetty: 26. tammikuuta 2009 10:03<br>
&gt; Vastaanottaja: MapServer<br>
&gt; Aihe: Re: [mapserver-users] Dynamin SQL with mapserver CGI?<br>
</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Hi <br>
&gt; <br>
&gt; &gt; You can use a replaceable parameter in the FILTER clause if all
you ... <br>
&gt; This introduces the hazard of SQL-Injection, doesn't it? <br>
&gt; <br>
&gt; Bye <br>
&gt; Benedikt Rothe <br>
&gt; <br>
&gt; mapserver-users-bounces@lists.osgeo.org schrieb am 24.01.2009 14:04:42:<br>
&gt; <br>
&gt; &gt; On Sat, Jan 24, 2009 at 3:18 AM, Saka Royban &lt;srph124@yahoo.com&gt;
wrote:<br>
&gt; &gt; &gt; Hi all<br>
&gt; &gt; &gt; I'm looking for a way to change SQL dynamically via URL
parameters. it<br>
&gt; &gt; &gt; sounds from doc that changing DATA element in map file is
impossible. Is<br>
&gt; &gt; &gt; there any other way?<br>
&gt; &gt; <br>
&gt; &gt; You can use a replaceable parameter in the FILTER clause if all
you<br>
&gt; &gt; want to do is alter the WHERE clause. So for example:<br>
&gt; &gt; &nbsp; &nbsp;FILTER &quot;%criteria%&quot;<br>
&gt; &gt; and<br>
&gt; &gt; &nbsp; criteria=id='value'<br>
&gt; &gt; would work with a database like Postgres.<br>
&gt; &gt; <br>
&gt; &gt; When working with a database you put the whole SQL WHERE clause
in the<br>
&gt; &gt; FILTER, whereas with shapefiles or ORG data sources you use the<br>
&gt; &gt; FILTERITEM and FILTER.<br>
&gt; &gt; <br>
&gt; &gt; -- <br>
&gt; &gt; Richard Greenwood<br>
&gt; &gt; richard.greenwood@gmail.com<br>
&gt; &gt; www.greenwoodmap.com<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; mapserver-users mailing list<br>
&gt; &gt; mapserver-users@lists.osgeo.org<br>
&gt; &gt; http://lists.osgeo.org/mailman/listinfo/mapserver-users</font></tt>