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

curl-and-php

simple form filler problem

From: Dave Fobare <editor_at_the-sports-page.com>
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("http://www.mysite.com/privatelogin");

curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
curl_close($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,"http://www.mysite.com/privatelogin");
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS,
"UserID=myuserid&Password=mypassword");

    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!

Thanks,

Dave Fobare

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-08-12