跳轉phpcurlcookie
$user,'Password'=> $pass,'RedirectAfterLoginUrl'=>'https://www.mql5.com/zh','RememberMe'=>false,);//step 1//擷取一個cookie$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);$content1 = curl_exec($ch);curl_close($ch);//step 2//post 資料;$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);// 從認證中檢查SSL密碼編譯演算法是否存在curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);// 自動跟隨跳轉curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);curl_setopt($ch, CURLOPT_AUTOREFERER, 1);curl_setopt($ch, CURLOPT_POST, count($fields));curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields_post));$result= curl_exec($ch);curl_close($ch);