问题,我得到令牌值,但是当我尝试登录时,它给出了一个错误。会话值也被接收。 answer.txt文件和cookie.txt中的所有信息。令牌与我的会话不匹配?因此,如果可以,我该如何解决。 我将用户名和密码留空,以便可以理解该问题。当您想重定向到相反的站点“ Server Error in” /“ Application”时。 “我收到一个错误。
<?php
session_start();
$USERNAME ="";
$PASSWORD ="";
$regs=array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $urlLogin);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_STDERR,$f = fopen("answer.txt", "w+"));
curl_setopt($ch, CURLOPT_HEADER, 0);
//curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36' );
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile);
curl_setopt( $ch, CURLOPT_COOKIESESSION, true );
curl_setopt($ch, CURLOPT_COOKIE, $cookieFile);
$data=curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, $urlSecuredPage);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData));
//curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile);
curl_setopt($ch, CURLOPT_COOKIE, $cookieFile);
$data = curl_exec($ch);
curl_close($ch);
?>