All pastes #547322 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-07 10:48 UTC
rendered paste body
Guys, i'm having a little problom with my Curl Function..
Look at my page:
http://www.forever.co.il/Test/CurlExample.php

i get Notices... which i'm not so sure what they are saying..
here is the code of CurlExample.php

<?php
// xml data as string
error_reporting(E_ALL);
$request = '<?xml version="1.0" encoding="UTF-8"?>'; 
$request .= '<DataFormSubmit>'; 
$request .= '<individual id="12345">'; 
$request .= '<FirstName>A</FirstName>'; 
$request .= '<LastName>B</LastName>'; 
$request .= '<Address>C</Address>'; 
$request .= '<Phone>D</Phone>'; 
$request .= '</individual>'; 
$request .= '</DataFormSubmit>'; 

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

// Send using curl 
$ch = curl_init(); 
curl_setopt( $ch, curlOPT_URL, "http://www.forever.co.il/Test/Test.php"); // URL to post 
curl_setopt( $ch, curlOPT_RETURNTRANSFER, 1 ); // return into a variable 
curl_setopt( $ch, curlOPT_HTTPHEADER, $header ); // headers from above 
curl_setopt( $ch, curlOPT_CUSTOMREQUEST, 'post' ); // special post with specified Content-type 
$result = curl_exec( $ch ); // runs the post 
curl_close($ch); 

echo $result; // echo reply response 
?>



The page that gets the post is Test.php
here is his code:
<pre>
<?php print_r($_POST);?>
</pre>