cURL / Mailing Lists / curl-and-php / Single Mail


simple form filler problem

From: Dave Fobare <>
Date: Sun, 12 Aug 2007 10:50:46 -0400

Under WAMP 1.7.2 on XP Pro, I'm trying to get the following simple form
filler to work:

$post = "UserID=myuserid&Password=mypassword";
$ch = curl_init("");

curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
echo $out;

All I'm getting out is the login page itself. I tried it another way:

    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL,"");
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS,

    curl_exec ($curl);
    curl_close ($curl);

and I get the same result. cURL is working; I've enabled it properly in
the php.ini under Apache2, and php_curl does show up as enabled on the
WAMP control panel. And I can run other cURL snippets. Those examples
above are directly cribbed from public sources, but I still must be
doing something wrong. Help!


Dave Fobare

Received on 2007-08-12