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

Heidt, Christopher M. CHRISTOPHER.M.HEIDT at saic.com
Wed Oct 8 09:23:39 EDT 2008


hrm, all I can think of is maybe callback is required...
add
callback: function(){alert('Maybe Im required')},
somewhere in there
 
did "getStringItem1" and "item2" make it inside the $_GET array?
In firebug, when you look at the response you are getting back is it
completely empty?
If so, try putting an echo an the beginning of your php file to see if
it is even getting there.

________________________________

From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
On Behalf Of Ian
Sent: Tuesday, October 07, 2008 8:13 PM
To: users at openlayers.org
Subject: Re: [OpenLayers-Users] OpenLayers.Request.POST/GET errors




	have you tried:
	new OpenLayers.Request.issue({
	    method: 'POST',
	    url:'http://www.host.com/lib/printMap.php
<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.sta
tus||(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/20081008/d82b2013/attachment.html


More information about the Users mailing list