jarcoal Posted May 6, 2008 Share Posted May 6, 2008 This is probably more of a Javascript problem, but I'm assuming most PHP developers have run into it now and then, so here it goes. I'm trying to post some vars back to my server with AJAX. I'm using this code to transmit back to the server: theMessenger.open("POST", postPage, true); theMessenger.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); theMessenger.setRequestHeader("Content-Length", theParameters.length); theMessenger.setRequestHeader("Connection", "close"); theMessenger.send(theParameters); From the client's point of view, it appears that the post went off with out a hitch, but the server is unable to interpret the variables. I can tell the server is getting the request, but the variables don't pass. I am assuming this is an encoding problem, as I've seen many tutorials that include encodeURI/encodeComponentURI. However I don't understand when those are required (just the variable values, or the &'s and ='s found in a parameter string?). Any help would be very appreciated. Link to comment https://forums.phpfreaks.com/topic/104292-ajax-posts-php/ Share on other sites More sharing options...
jarcoal Posted May 6, 2008 Author Share Posted May 6, 2008 bump Link to comment https://forums.phpfreaks.com/topic/104292-ajax-posts-php/#findComment-534376 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.