Hi,
I have server which is posting me these data through curl.
$strPost = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
$strPost .= "<request>";
$strPost .= "<type>login</type>";
$strPost .= "<session>21</session>";
$strPost .= "</request>";
$url = "http://www.abc.com/xyz.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPGET,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $strPost); // add POST fields
curl_setopt($ch, CURLOPT_POST, 1);
$result = curl_exec($ch);
if($result == true) {
echo $result;
}
curl_close($ch);
I wanna read the above xml send i.e $strPost at http://www.abc.com/xyz.php i m trying to read it with $_POST['strPost'] but shows empty.
Can anyone help me.