curl-users
Beginners problem - Empty BODY
Date: Sun, 10 Jun 2007 17:24:52 +0200
Hi, I've stumbled upon cURL when I way searching for a way to POST variables
to another site, without the use of forms.
The code I have found looks like this with my modifications:
-----
<?php
$URL="site.com/xxx.php?";
$username = "username=xxxxx";
$password = "password=xxxxx";
$destination = "destination=xxxxx";
$originatortype = "originatortype=xxxxx";
$originator = "originator=xxxxx";
$text = "test";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://$URL");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $username . '&' . $password . '&' .
$destination . '&' . $originatortype . '&' . $originator . '&' . $text);
curl_exec ($ch);
curl_close ($ch);
unset($username, $password, $destination, $text);
?>
It seems to be working well, exept for that it apperantly produces an "empty
body", which the script I'm trying to comunicate with don't accept. How can
I solve this?
Thnx // Alex
Received on 2007-06-10