I would like to be able to read XMLHttpRequest that is sent to a PHP page. I am using prototype's Ajax.Request function, and I am sending a simple XML structure.
When trying to print the POST array on the PHP page, I don't get any output.
Any help appreciated.
EDIT: Below is my code
<html>
<head>
<SCRIPT type="text/javascript" src="prototype.js"></script>
</head>
<body>
<script type="text/javascript">
var xml='<?xml version=1.0 encoding=UTF-8?>';
xml=xml+'<notification>';
xml=xml+'heya there';
xml=xml+'</notification>';
xml=xml+'</xml>';
var myAjax = new Ajax.Request('http://localhost:8080/post2.php',{
contentType: 'text/xml',
parameters: xml,
method: 'post',
onSuccess: function(transport){ alert(transport.status); alert(transport.responseText); }
});
</script>
</body>
</html>
post2.php
Welcome <?php print_r($_POST); ?>!<br />