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

Ian iansgis at gmail.com
Tue Oct 7 20:12:47 EDT 2008


> have you tried:
> new OpenLayers.Request.issue({
>     method: 'POST',
>     url:'http://www.host.com/lib/printMap.php',
>     params: {
>         getStringItem1:'cheesburger',
>         item2:'wambat'
>     },
>     data:{
>         postedUsername: 'myUsername',
>         postedPassword: 'myPassword'
>     },
>     success: function(request){
>         alert(request.responseText);
>     },
>     failure:function(request){         alert('BOOOOOO!');
>     }
> });
>
> and have you checked the $_GET and $_POST arrays in PHP? the request array
> is usually frowned upon.
>


Thank you for the reply Chris. I tried your example and I get the javascript
error "complete is not a function" at line 332:

request.onreadystatechange=function(){if(request.readyState==OpenLayers.Request.XMLHttpRequest.DONE){complete(request);if(success&&(!request.status||(request.status>=200&&request.status<300))){success(request);}


The parameters "getStringItem1" and "item2" are posted according to Firebug.
The $_POST array is empty, likely due to the error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081007/b9c7cf58/attachment.html


More information about the Users mailing list