<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000;"><div><div style="font-family: times,serif; font-size: 12pt; color: rgb(0, 0, 0);"><div style="color: rgb(0, 0, 0); font-family: times,serif; font-size: 12pt;">Hello list</div><div><font class="Apple-style-span" size="3" face="'times new roman', 'new york', times, serif"><br><br> I am trying to do </font><font class="Apple-style-span" face="'times new roman', 'new york', times, serif">similar to </font><a rel="nofollow" target="_blank" href="http://www.openlayers.org/dev/examples/getfeatureinfo-popup.html"><span class="yshortcuts" id="lw_1300468723_0">http://www.openlayers.org/dev/examples/getfeatureinfo-popup.html</span></a> example, but I could not done yet because feature did not view probably. I am using Openlayer and Geoext running
in mapfish enviroment (but without any mapfish commends and library only run as env of mapfish).</div><div><span>I put my example on <a rel="nofollow" target="_blank" href="http://131.175.143.99/form.html"><span class="yshortcuts" id="lw_1300468723_1">http://131.175.143.99/form.html</span></a> and when I click on the map, responses an errors as<br><br></span><span>!/usr/bin/env python
"""This is a blind proxy that we use to get around browser
restrictions that prevent the Javascript from loading pages not on the
same server as the Javascript. This has several problems: it's less
efficient, it might break some sites, and it's a security risk because
people can use this proxy to browse the web and possibly do bad stuff
with it. It only loads pages via http and https, but it can load any
content type. It supports GET and POST requests."""
import urllib2
import cgi
import sys, os
# Designed to prevent Open Proxy type stuff.
allowedHosts = ['131.175.143.99', 'localhost:8081']
method = os.environ["REQUEST_METHOD"]
if method == "POST":
qs = os.environ["QUERY_STRING"]
d = cgi.parse_qs(qs)
if d.has_key("url"):
url = d["url"][0]
else:
url = "<a target="_blank" href="http://131.175.143.99">http://131.175.143.99</a>"
else:
fs = cgi.FieldStorage()
url = fs.getvalue('url', "<a target="_blank" href="http://131.175.143.99">http://131.175.143.99</a>")
try:
host = url.split("/")[2]
if allowedHosts and not host in allowedHosts:
print "Status: 502 Bad Gateway"
print "Content-Type: text/plain"
print
print "This proxy does not allow you to access that location (%s)." % (host,)
print
print os.environ
elif url.startswith("<a target="_blank" href="http://">http://</a>") or url.startswith("<a target="_blank" href="https://">https://</a>"):
if method == "POST":
length = int(os.environ["CONTENT_LENGTH"])
headers = {"Content-Type": os.environ["CONTENT_TYPE"]}
body = sys.stdin.read(length)
r = urllib2.Request(url, body, headers)
y = urllib2.urlopen(r)
else:
y = urllib2.urlopen(url)
# print content type header
i = y.info()
if i.has_key("Content-Type"):
print "Content-Type: %s" % (i["Content-Type"])
else:
print "Content-Type: text/plain"
print
print y.read()
y.close()
else:
print "Content-Type: text/plain"
print
print "Illegal request."
except Exception, E:
print "Status: 500 Unexpected Error"
print "Content-Type: text/plain"
print
print "Some unexpected error occurred. Error text was:", E</span><br></div><div><br></div><br><br><div>my main script code in js file as bellow</div><div><br>OpenLayers.ProxyHost = "proxy.cgi?url=";<br><br><br></div><div><div>Ext.onReady(function() {</div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>var bounds = new OpenLayers.Bounds(</div><div> 100, 20,</div><div> 110, 25 );</div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>mapOptions = {</div><div><span class="Apple-tab-span" style="white-space: pre;">                </span>maxExtent: bounds, </div><div><span class="Apple-tab-span" style="white-space: pre;">                </span>maxResolution: 'auto',</div><div><span class="Apple-tab-span" style="white-space: pre;">                </span>projection: "EPSG:4326",</div><div><span
class="Apple-tab-span" style="white-space: pre;">                </span>numZoomLevels: 35 ,</div><div><span class="Apple-tab-span" style="white-space: pre;">                </span>units: "m",</div><div><span class="Apple-tab-span" style="white-space: pre;">                </span>allOverlays: false </div><div><span class="Apple-tab-span" style="white-space: pre;">                </span>};<span class="Apple-tab-span" style="white-space: pre;">                                </span></div><div><span class="Apple-tab-span" style="white-space: pre;">                </span></div><div> var map = new OpenLayers.Map('map',mapOptions);</div></div><div><div>var basin = new OpenLayers.Layer.WMS(</div><div><span class="Apple-tab-span" style="white-space: pre;">                </span><span>"VN", "<a rel="nofollow" target="_blank" href="http://131.175.143.99:8081/geoserver/wms"><span class="yshortcuts" id="lw_1300468723_3">http://131.175.143.99:8081/geoserver/wms</span></a>",</span></div><div><span class="Apple-tab-span" style="white-space: pre;">        
        </span>{</div><div><span class="Apple-tab-span" style="white-space: pre;">                        </span>layers: 'topp:basin',</div><div><span class="Apple-tab-span" style="white-space: pre;">                <br>        </span>transparent: true,</div><div><span class="Apple-tab-span" style="white-space: pre;">                        </span>format: "image/gif",</div><div><span class="Apple-tab-span" style="white-space: pre;">                </span>},</div><div><span class="Apple-tab-span" style="white-space: pre;">                </span>{isBaseLayer: false} </div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>);</div><div><span class="Apple-tab-span" style="white-space: pre;"><br></span></div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>map.addLayer(basin);</div></div><div><br></div><div><div>info = new OpenLayers.Control.WMSGetFeatureInfo({</div><div><span> url: '<a rel="nofollow" target="_blank"
href="http://131.175.143.99:8081/geoserver/wms">http://131.175.143.99:8081/geoserver/wms</a>', </span></div><div> title: 'Identify features by clicking',</div><div>
queryVisible: true,</div><div> eventListeners: {</div><div> getfeatureinfo: function(event) {</div><div> map.addPopup(new OpenLayers.Popup.FramedCloud(</div><div> "chicken", </div><div> map.getLonLatFromPixel(event.xy),</div><div> null,</div><div> event.text,</div><div> null,</div><div>
true</div><div> ));</div><div> }</div><div> }</div><div> });</div><div><br></div><div> map.addControl(info);</div><div> info.activate();</div></div><div>...........</div><div>.........</div><div>........</div><div><div>mainPanel = new GeoExt.form.FormPanel({</div><div> renderTo: "mainpanel",</div><div> layout: "border",</div><div> height: 400,</div><div> width: 920,<span class="Apple-tab-span" style="white-space: pre;">        </span> </div><div> items: mapPanel</div><div>
});</div></div><div>if I change <br></div><div>Could you please give me advice in this case.</div><div><br></div><div>Many thanks </div><div><br></div><div>Quang</div>
</div></div>
</div><br>
</body></html>