我正在尝试使用 cURL 登录网站我已经阅读了该网站上的许多答案,但仍然无法获得它。请有人可以帮我找到解决方案
$url = 'https://secure.chess.com/login';
$postfields = "c1=USERNAME&loginpassword=PASSWORD&rememberme=";
$cookie = "cookie.txt";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
$response = curl_exec($ch);
echo $response;