嗨,我正在尝试使用Curl php登录网站,然后我需要重定向到其他页面,并且应该删除该用户,并且该网站到目前为止使用的是自签名证书,但我可以登录,但我不能确定之后会发生什么,因此场景是:
我的代码如下:
SELECT name, ID
FROM ( SELECT name, ID1, ID2, ID3 FROM table1)p
UNPIVOT
(ID FOR ID_value IN (ID1, ID2, ID3)) AS unpvt;
重定向到删除页面(我不确定它是否正确):
$sslCertificate = PATH to ssl certificate
$$cookie_file_path = PATH TO TXT FILE
$url = mylogin page
//login
curl_setopt($ch, CURLOPT_HTTPHEADER, array($Header ifno..etc));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIE, "cookiename=0");
curl_setopt($ch,CURLOPT_SSLCERT , $sslCertificate);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $username , $passwrod,$token);
curl_exec($ch);
$html = curl_exec($ch);
print_r($html);
curl_close($ch);
可以登录,但可以重定向到$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, $url2todeleteUser );
curl_setopt($ch2, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch2,CURLOPT_COOKIEFILE,$cookie_file_path);
curl_setopt($ch2, CURLOPT_COOKIE, "cookiename=0");
curl_setopt($ch2,CURLOPT_SSLCERT , $sslCertificate);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
$html = curl_exec($ch2);
var_dump($html);
curl_close($ch2);
,但没有收到任何响应或错误,也没有更改