[OSGeo-UK] How do you use OpenLayers.ProxyHost?

Peter Cotroneo Peter.Cotroneo at ordnancesurvey.co.uk
Tue Mar 15 09:05:33 EDT 2011


Hi,

 

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.).

 

My JavaScript code looks like this:

 

var uri = "http://46.137.1.44/gazetteer/postcode?q=" + queryText;     

       

OpenLayers.ProxyHost="proxy.php?q="+queryText;

 

OpenLayers.loadURL(uri, '', this, pcInfo, pcFailure);

 

And my PHP proxy looks like this:

 

<?php

$ IP_ADDRESS = '46.137.1.44';

  echo file_get_contents('http://' . $IP_ADDRESS .
'/gazetteer/postcode?q=' . urlencode($_GET['q']));

?>

 

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.

 

Any ideas?

 

Cheers,

 

Peter


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/uk/attachments/20110315/6e0b46c2/attachment.html


More information about the UK mailing list