Anyone using curl to login to a remote SSL host?
This snippet attempts to mimic a remote form that posts to "validate.php," a script expecting only two values (login, password):
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://remotehost/validate.php");
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"login=foo&password=bar");
$result = curl_exec ($ch);
curl_close($ch);
print $result;
I thought something like this would do it but I've had no luck - I just get the remote form back in output. It's like the posted values are being ignored.
Am I missing the point of CURL here? If so, an alternative besides javascript for posting the form data would be very, very nice. Thanks.