" . $xmlpost . "\n" ); } else { $postvars = ''; while ( $element = current ( $_POST ) ) { if (key ( $_POST ) != "csw_request") $postvars .= key ( $_POST ) . '=' . $element . '&'; else $postvars .= $element . '&'; next ( $_POST ); } curl_setopt ( $session, CURLOPT_POST, true ); curl_setopt ( $session, CURLOPT_POSTFIELDS, $_POST ['csw_request'] ); if (isset ( $i3geo_proxy_server ) && $i3geo_proxy_server != "") { curl_setopt ( $session, CURLOPT_PROXY, $i3geo_proxy_server ); } curl_setopt ( $session, CURLOPT_HTTPHEADER, Array ( "Content-Type: application/x-www-form-urlencoded" ) ); if ($logging) fwrite ( $fh, $timestamp . ": POST> " . $_POST ['csw_request'] . "\n" ); } } else if ($_GET ['csw_request']) { curl_setopt ( $session, CURLOPT_POST, true ); curl_setopt ( $session, CURLOPT_POSTFIELDS, $_GET ['csw_request'] ); if (isset ( $i3geo_proxy_server ) && $i3geo_proxy_server != "") { curl_setopt ( $session, CURLOPT_PROXY, $i3geo_proxy_server ); } curl_setopt ( $session, CURLOPT_HTTPHEADER, Array ( "Content-Type: application/x-www-form-urlencoded" ) ); if ($logging) fwrite ( $fh, $timestamp . ": GET> " . $_GET ['csw_request'] . "\n" ); } // Don't return HTTP headers. Do return the contents of the call curl_setopt ( $session, CURLOPT_HEADER, false ); curl_setopt ( $session, CURLOPT_RETURNTRANSFER, true ); // Make the call $xml = curl_exec ( $session ); // The web service returns XML. Set the Content-Type appropriately /* * if(file_exists("c:/temp/csw.xml")){ * $fp = fopen("c:/temp/csw.xml","r"); * $xml = fread($fp,filesize("c:/temp/csw.xml")); * fclose($fp); * } * else * {$xml = curl_exec($session);} */ header ( "Content-Type: text/xml" ); if ($logging) { fwrite ( $fh, $timestamp . ": RESPONSE> " . $xml . "\n" ); fclose ( $fh ); } echo $xml; curl_close ( $session ); //} ?>