All pastes #547453 Raw Edit

Someone

public text v1 · immutable
·published 2007-06-07 11:58 UTC
rendered paste body
This is a test script to see if it POSTS the xml..
I don't get an error or a notice... but i don't know if it passes the xml.
it didn't echo anything at the end.. so.. how can i tell?

<?php
error_reporting(E_ALL);

$xml = '<?xml version="1.0" encoding="UTF-8"?>'; 
$xml .= '<DataFormSubmit>'; 
$xml .= '<individual id="12345">'; 
$xml .= '<FirstName>A</FirstName>'; 
$xml .= '<LastName>B</LastName>'; 
$xml .= '<Address>C</Address>'; 
$xml .= '<Phone>D</Phone>'; 
$xml .= '</individual>'; 
$xml .= '</DataFormSubmit>'; 

$header[] = "Host: www.example.com"; 
$header[] = "Content-type: text/xml"; 
$header[] = "Content-length: ".strlen($xml) . "\r\n"; 
$header[] = $xml; 

$url = "http://www.forever.co.il/Test/OutPut.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $header); 
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s 
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>