'example@example.com', 'password' => 'passwordhere' ); // client id, API key and secret $postfields = array( 'id' => 12345, 'key' => 'c2a022dcf81cd9ae658d8340b1c29a29', 'secret'=>'efea4199ea9ccc1813bcae905d3099d8c29ca2d671245a667faa01253cc6328e' ); $xmlFilePath = 'properties.xml'; if(function_exists('gzcompress')) { // compress data if gzcompress is availble $postfields['xml'] = gzcompress(file_get_contents($xmlFilePath)); $postfields['compressed'] = true; } else { $postfields['xml'] = file_get_contents($xmlFilePath); } if (function_exists('curl_version')) { // if curl is installed and enabled $ch = curl_init($remoteUrl); curl_setopt($ch, CURLOPT_NOBODY, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $curlInfo = curl_version(); curl_setopt($ch, CURLOPT_USERAGENT, 'PHP: ' . phpversion() . ' ; curl: ' . $curlInfo['version']); $response = curl_exec($ch); curl_close($ch); } else { $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($postfields), ), ); $context = stream_context_create($options); $response = file_get_contents($remoteUrl, false, $context); } header('content-type: text/xml'); echo '' . $response . ''; exit;