<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="address"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="country-region"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-GB link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Cheers, Matt.&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>It looks as if my PHP proxy was fine, but
I needed a slight change in my JavaScript code:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black;background:white'>OpenLayers</span></font><font size=2
color="#5c5c5c" face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:#5C5C5C;background:white'>.</span></font><font size=2
color=black face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black;background:white'>ProxyHost</span></font><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
background:white'> <font color="#5c5c5c"><span style='color:#5C5C5C'>=</span></font>
<font color="#005c00"><span style='color:#005C00'>&quot;proxy.php?q=&quot;</span></font><font
color="#5c5c5c"><span style='color:#5C5C5C'>;</span></font></span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black;background:white'>uri</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";background:white'> <font
color="#5c5c5c"><span style='color:#5C5C5C'>=</span></font> <font color=black><span
style='color:black'>OpenLayers</span></font><font color="#5c5c5c"><span
style='color:#5C5C5C'>.</span></font><font color=black><span style='color:black'>ProxyHost</span></font>
<font color="#5c5c5c"><span style='color:#5C5C5C'>+</span></font> <font
color=black><span style='color:black'>encodeURIComponent</span></font><font
color="#5c5c5c"><span style='color:#5C5C5C'>(</span></font><font color=black><span
style='color:black'>queryText</span></font><font color="#5c5c5c"><span
style='color:#5C5C5C'>);</span></font></span></font><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black;background:white'>OpenLayers</span></font><font
size=2 color="#5c5c5c" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#5C5C5C;background:white'>.</span></font><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black;background:white'>loadURL</span></font><font size=2
color="#5c5c5c" face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:#5C5C5C;background:white'>(</span></font><font size=2
color=black face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black;background:white'>uri</span></font><font size=2 color="#5c5c5c"
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:#5C5C5C;background:white'>,</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";background:white'> <font
color="#005c00"><span style='color:#005C00'>''</span></font><font
color="#5c5c5c"><span style='color:#5C5C5C'>,</span></font> <b><font
color="#0000c0"><span style='color:#0000C0;font-weight:bold'>this</span></font></b><font
color="#5c5c5c"><span style='color:#5C5C5C'>,</span></font> <font color=black><span
style='color:black'>pcInfo</span></font><font color="#5c5c5c"><span
style='color:#5C5C5C'>,</span></font> pc<font color=black><span
style='color:black'>Failure</span></font><font color="#5c5c5c"><span
style='color:#5C5C5C'>);</span></font></span></font><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Peter<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
Matt Walker [mailto:walkermatt@longwayaround.org.uk] <br>
<b><span style='font-weight:bold'>Sent:</span></b> 15 March 2011 19:08<br>
<b><span style='font-weight:bold'>To:</span></b> Peter Cotroneo<br>
<b><span style='font-weight:bold'>Cc:</span></b> uk@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [OSGeo-UK] How do you
use OpenLayers.ProxyHost?</span></font><span lang=EN-US><o:p></o:p></span></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>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'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<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On 15 March 2011 13:05, Peter Cotroneo &lt;<a
href="mailto:Peter.Cotroneo@ordnancesurvey.co.uk">Peter.Cotroneo@ordnancesurvey.co.uk</a>&gt;
wrote:<o:p></o:p></span></font></p>

<div link=blue vlink=purple>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>Hi,<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

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

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>My JavaScript code
looks like this:<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><font
size=2 color="#0000c0" face="Courier New"><span style='background-attachment:
scroll;background-position-x:0%;background-position-y:0%'><span
style='font-size:10.0pt;font-family:"Courier New";color:#0000C0;background:
white;font-weight:bold'>var</span></span></font></b><font size=2
face="Courier New"><span style='background-attachment:scroll;background-position-x:
0%;background-position-y:0%'><span style='font-size:10.0pt;font-family:"Courier New";
background:white'> <font color=black><span style='color:black'>uri</span></font>
<font color="#5c5c5c"><span style='color:#5C5C5C'>=</span></font> <font
color="#005c00"><span style='color:#005C00'>&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:#5C5C5C'>+</span></font> <font
color=black><span style='color:black'>queryText</span></font><font
color="#5c5c5c"><span style='color:#5C5C5C'>;</span></font>&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='background-attachment:scroll;background-position-x:
0%;background-position-y:0%'><span style='font-size:10.0pt;font-family:"Courier New";
background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=green face="Courier New"><span style='background-attachment:scroll;
background-position-x:0%;background-position-y:0%'><span style='font-size:10.0pt;
font-family:"Courier New";color:green;background:white'>OpenLayers.ProxyHost=&quot;</span></span></font><font
size=2 color=green face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:green'>proxy.php?q=&#8221;+queryText;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=black face="Courier New"><span style='background-attachment:scroll;
background-position-x:0%;background-position-y:0%'><span style='font-size:10.0pt;
font-family:"Courier New";color:black;background:white'>OpenLayers</span></span></font><font
size=2 color="#5c5c5c" face="Courier New"><span style='background-attachment:
scroll;background-position-x:0%;background-position-y:0%'><span
style='font-size:10.0pt;font-family:"Courier New";color:#5C5C5C;background:
white'>.</span></span></font><font size=2 color=black face="Courier New"><span
style='background-attachment:scroll;background-position-x:0%;background-position-y:
0%'><span style='font-size:10.0pt;font-family:"Courier New";color:black;
background:white'>loadURL</span></span></font><font size=2 color="#5c5c5c"
face="Courier New"><span style='background-attachment:scroll;background-position-x:
0%;background-position-y:0%'><span style='font-size:10.0pt;font-family:"Courier New";
color:#5C5C5C;background:white'>(</span></span></font><font size=2 color=black
face="Courier New"><span style='background-attachment:scroll;background-position-x:
0%;background-position-y:0%'><span style='font-size:10.0pt;font-family:"Courier New";
color:black;background:white'>uri</span></span></font><font size=2
color="#5c5c5c" face="Courier New"><span style='background-attachment:scroll;
background-position-x:0%;background-position-y:0%'><span style='font-size:10.0pt;
font-family:"Courier New";color:#5C5C5C;background:white'>,</span></span></font><font
size=2 face="Courier New"><span style='background-attachment:scroll;background-position-x:
0%;background-position-y:0%'><span style='font-size:10.0pt;font-family:"Courier New";
background:white'> <font color="#005c00"><span style='color:#005C00'>''</span></font><font
color="#5c5c5c"><span style='color:#5C5C5C'>,</span></font> <b><font
color="#0000c0"><span style='color:#0000C0;font-weight:bold'>this</span></font></b><font
color="#5c5c5c"><span style='color:#5C5C5C'>,</span></font> <font color=black><span
style='color:black'>pcInfo</span></font><font color="#5c5c5c"><span
style='color:#5C5C5C'>,</span></font> <font color=black><span style='color:
black'>pcFailure</span></font><font color="#5c5c5c"><span style='color:#5C5C5C'>);</span></span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color="#5c5c5c" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#5C5C5C'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color="#5c5c5c" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#5C5C5C'>And my PHP proxy looks like this:</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color="#5c5c5c" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#5C5C5C'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&lt;?php</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>$
IP_ADDRESS = &#8216;<font color="#005c00"><span style='background-attachment:
scroll;background-position-x:0%;background-position-y:0%'><span
style='color:#005C00;background:white'>46.137.1.44</span></span></font>&#8217;;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;
echo file_get_contents('http://' . $IP_ADDRESS . '/gazetteer/postcode?q=' .
urlencode($_GET['q']));</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>?&gt;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>The
proxy is running on a LAMP stack.&nbsp; I&#8217;ve used this proxy for a
straight <st1:City w:st="on"><st1:place w:st="on">AJAX</st1:place></st1:City>
call, and it works fine. &nbsp;I&#8217;m assuming, then, that I&#8217;m using
OpenLayers.ProxyHost incorrectly.</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>Any
ideas?</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>Cheers,</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>Peter</span></font><o:p></o:p></p>

</div>

</div>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'>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.<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>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's behalf via email. We reserve the right to monitor emails and attachments without prior notice.<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>Thank you for your cooperation.<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>Ordnance Survey<o:p></o:p></span></font></pre><pre><st1:Street
w:st="on"><st1:address w:st="on"><font size=2 face="Courier New"><span
  style='font-size:10.0pt'>Adanac Drive</span></font></st1:address></st1:Street><o:p></o:p></pre><pre><st1:place
w:st="on"><font size=2 face="Courier New"><span style='font-size:10.0pt'>Southampton</span></font></st1:place> SO16 0AS<o:p></o:p></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>Tel: 08456 050505<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><a
href="http://www.ordnancesurvey.co.uk" target="_blank">http://www.ordnancesurvey.co.uk</a><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></pre>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
_______________________________________________<br>
<st1:country-region w:st="on"><st1:place w:st="on">UK</st1:place></st1:country-region>
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><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>

<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'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
http://www.ordnancesurvey.co.uk