Skip to content

Instantly share code, notes, and snippets.

@marwenblel
Created December 29, 2014 21:24
Show Gist options
  • Save marwenblel/005972b33bfeaa708fb1 to your computer and use it in GitHub Desktop.
Save marwenblel/005972b33bfeaa708fb1 to your computer and use it in GitHub Desktop.
hello iam trying to excecute this php file with curl.
its start charging my browser and no response !!!
whats i miss here?
<?php
$url = 'http://apps.dev/flickr_app/index.php';
$data = <<<XML
<books>
<book>
<name>Book3</name>
<author>Auth3</author>
<isbn>ISBN0003</isbn>
</book>
<book>
<name>Book4</name>
<author>Auth4</author>
<isbn>ISBN0004</isbn>
</book>
</books>
XML;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment