Hi Peter,<br><br>Have you seen: <a href="http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#ProxyHost">http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#ProxyHost</a> ?<br><br>It&#39;s been a while since I had need to set up a ProxyHost but I think that OpenLayers appends the complete URL that it is looking to request data from to the URL specified as the ProxyHost.<br>
<br>Hope that helps,<br><br>Matt.<br>-- <br>Matt Walker<br>@_walkermatt<br><br><div class="gmail_quote">On 15 March 2011 13:05, Peter Cotroneo <span dir="ltr">&lt;<a href="mailto:Peter.Cotroneo@ordnancesurvey.co.uk">Peter.Cotroneo@ordnancesurvey.co.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">











<div link="blue" vlink="purple" lang="EN-GB">

<div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">Hi,</span></font></p>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">I’m running into a cross-site scripting issue with
OpenLayers.loadURL, and I’m not sure how to use OpenLayers.ProxyHost. 
I can’t seem to find any documentation that says where to specify this
parameter (in JavaScript code, a config file, etc.).</span></font></p>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">My JavaScript code looks like this:</span></font></p>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>

<p class="MsoNormal" style=""><b><font size="2" color="#0000c0" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192); background: none repeat scroll 0% 0% white; font-weight: bold;">var</span></font></b><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; background: none repeat scroll 0% 0% white;"> <font color="black"><span style="color: black;">uri</span></font>
<font color="#5c5c5c"><span style="color: rgb(92, 92, 92);">=</span></font> <font color="#005c00"><span style="color: rgb(0, 92, 0);">&quot;<a href="http://46.137.1.44/gazetteer/postcode?q=" target="_blank">http://46.137.1.44/gazetteer/postcode?q=</a>&quot;</span></font>
<font color="#5c5c5c"><span style="color: rgb(92, 92, 92);">+</span></font> <font color="black"><span style="color: black;">queryText</span></font><font color="#5c5c5c"><span style="color: rgb(92, 92, 92);">;</span></font>    
</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; background: none repeat scroll 0% 0% white;">      
</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>

<p class="MsoNormal" style=""><font size="2" color="green" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green; background: none repeat scroll 0% 0% white;">OpenLayers.ProxyHost=&quot;</span></font><font size="2" color="green" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">proxy.php?q=”+queryText;</span></font></p>


<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black; background: none repeat scroll 0% 0% white;">OpenLayers</span></font><font size="2" color="#5c5c5c" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">.</span></font><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black; background: none repeat scroll 0% 0% white;">loadURL</span></font><font size="2" color="#5c5c5c" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">(</span></font><font size="2" color="black" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black; background: none repeat scroll 0% 0% white;">uri</span></font><font size="2" color="#5c5c5c" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">,</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; background: none repeat scroll 0% 0% white;"> <font color="#005c00"><span style="color: rgb(0, 92, 0);">&#39;&#39;</span></font><font color="#5c5c5c"><span style="color: rgb(92, 92, 92);">,</span></font> <b><font color="#0000c0"><span style="color: rgb(0, 0, 192); font-weight: bold;">this</span></font></b><font color="#5c5c5c"><span style="color: rgb(92, 92, 92);">,</span></font> <font color="black"><span style="color: black;">pcInfo</span></font><font color="#5c5c5c"><span style="color: rgb(92, 92, 92);">,</span></font> <font color="black"><span style="color: black;">pcFailure</span></font><font color="#5c5c5c"><span style="color: rgb(92, 92, 92);">);</span></font></span></font><font size="2" color="#5c5c5c" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(92, 92, 92);"></span></font></p>


<p class="MsoNormal"><font size="2" color="#5c5c5c" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(92, 92, 92);"> </span></font></p>

<p class="MsoNormal"><font size="2" color="#5c5c5c" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(92, 92, 92);">And my PHP proxy
looks like this:</span></font></p>

<p class="MsoNormal"><font size="2" color="#5c5c5c" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(92, 92, 92);"> </span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;?php</span></font></p>

<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">$ IP_ADDRESS = ‘<font color="#005c00"><span style="color: rgb(0, 92, 0); background: none repeat scroll 0% 0% white;">46.137.1.44</span></font>’;</span></font></p>


<p class="MsoNormal" style=""><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">  echo
file_get_contents(&#39;http://&#39; . $IP_ADDRESS . &#39;/gazetteer/postcode?q=&#39; . urlencode($_GET[&#39;q&#39;]));</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">?&gt;</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">The proxy is running on a LAMP stack.  I’ve
used this proxy for a straight AJAX
call, and it works fine.  I’m assuming, then, that I’m using
OpenLayers.ProxyHost incorrectly.</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Any ideas?</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Cheers,</span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> </span></font></p>

<p class="MsoNormal"><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">Peter</span></font></p>

</div>

</div>



<pre>This email is only intended for the person to whom it is addressed and may contain confidential information. If you have received this email in error, please notify the sender and delete this email which must not be copied, distributed or disclosed to any other person.

Unless stated otherwise, the contents of this email are personal to the writer and do not represent the official view of Ordnance Survey. Nor can any contract be formed on Ordnance Survey&#39;s behalf via email. We reserve the right to monitor emails and attachments without prior notice.

Thank you for your cooperation.

Ordnance Survey
Adanac Drive
Southampton SO16 0AS
Tel: 08456 050505
<a href="http://www.ordnancesurvey.co.uk" target="_blank">http://www.ordnancesurvey.co.uk</a>

</pre><br>_______________________________________________<br>
UK mailing list<br>
<a href="mailto:UK@lists.osgeo.org">UK@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/uk" target="_blank">http://lists.osgeo.org/mailman/listinfo/uk</a><br>
<br></blockquote></div><br><br>