Getting POST Data in Request

Hi,

I’ve been trying to read in an xml value of a post request… it’s kinda hard to explain, so here’s a little excerpt of what the HTTP POST request I’ll be sending to the PHP page will look like (obviously there is really more…):

How do I access the last xml part in PHP? It is a valid HTTP request as far as I know, but PHP doesn’t seem to allow you to get it. It only allows access to that if you have something equaling it…

Thanks :slight_smile:

$HTTP_POST_DATA?

EDIT: It’s actually $HTTP_RAW_POST_DATA, not $HTTP_POST_DATA :wink:

$_POST

fluid_tw0: It’s not $_POST, because that only contains key-value pairs. If you simply pass it data, it won’t go into that array.

Nick: Works beautifully. Thank you. :slight_smile:

fluid_tw0: It’s not $_POST, because that only contains key-value pairs. If you simply pass it data, it won’t go into that array.

Nick: Works beautifully. Thank you. :slight_smile:

Edit: Here’s the nice pretty code that I used:

<?php
$inputSocket = fopen('php://input','rb');
$contents = stream_get_contents($inputSocket);
fclose($inputSocket);

echo $contents;
?> 

More info here:
http://ee.php.net/manual/en/wrappers.php.php

[whisper]I’m surprised nobody ever uses these things… it’d be great for ajax.[/whisper]

now i see it :smiley: