<html 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)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* 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:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@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=purple>

<div class=Section1>

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

<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><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><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><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><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='text-autospace:none'><b><font size=2 color="#0000c0"
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:#0000C0;background:white;font-weight:bold'>var</span></font></b><font
size=2 face="Courier New"><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;http://46.137.1.44/gazetteer/postcode?q=&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></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 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green;background:white'>OpenLayers.ProxyHost=&quot;</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;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</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> <font color=black><span style='color:
black'>pcFailure</span></font><font color="#5c5c5c"><span style='color:#5C5C5C'>);</span></font></span></font><font
size=2 color="#5c5c5c" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#5C5C5C'><o:p></o:p></span></font></p>

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

<p class=MsoNormal><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:<o:p></o:p></span></font></p>

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

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&lt;?php<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>$ IP_ADDRESS = &#8216;<font
color="#005c00"><span style='color:#005C00;background:white'>46.137.1.44</span></font>&#8217;;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><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']));<o:p></o:p></span></font></p>

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

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

<p class=MsoNormal><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.<o:p></o:p></span></font></p>

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

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

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

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

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

<p class=MsoNormal><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>

</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