Hi, I have just installed latest php & curl in my debian 10.6 box and playing with curl.
I was trying to post a form that is https. here is the code:
$curl = curl_init("https://www.sampledomain.com/mylogin.php");
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_HEADER, FALSE);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)");
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_SSLVERSION,3);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
$post_string = "uid=someusrid&pwd=somepassword";
//echo $post_string;
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_string);
// $output contains the output string
$output = curl_exec($curl);
when I run the php page, it again gave me the login page
any clue?
Thanks,
Mahesh