[OpenLayers-Users] OpenLayers.Request.POST/GET errors

Ian iansgis at gmail.com
Tue Oct 7 16:52:33 EDT 2008


I am working on the Printing code from the wiki using the new ver. 2.7
OpenLayers.Request.POST/GET. The problem is that data is not appearing in
PHP's @$_REQUEST array. For example:

var printURL = 'http://www.host.com/lib/printMap.php';
var size = map.getSize();
var postParams = 'width=' + size.w + '&height=' + size.h;
new OpenLayers.Request.POST({url:printURL, data:postParams,
callback:printDone});

results in an empty REQUEST array. Firebug says width=500&height=500 is
posted. Same for GET:

var printURL = 'http://www.host.com/lib/printMap.php';
var size = map.getSize();
var getParams = {width: size.w, height: size.h};
new OpenLayers.Request.GET({url:printURL, params:getParams,
callback:printDone});

Submitting parameters directly (eg.
http://www.host.com/lib/printMap.php?width=500&height=400) does place the
values in the REQUEST array. I'm following the examples at
http://trac.openlayers.org/wiki/Request and using Apache 2/PHP 5.2.6/Firefox
3.03. Am I missing something?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081007/4887c9b1/attachment.html


More information about the Users mailing list