即時通訊使用curl登錄bukalapak.com。 但總是重定向「你正在重定向」&我解決它使用捲曲跟位是真的,但爲什麼不在重定向後內嵌? 幫我&感謝之前bukalapak.com登錄使用PHP捲曲
<?php
function curl($url, $post){
$curl = curl_init();
curl_setopt_array($curl,
array(CURLOPT_URL => $url, //put your url here
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_RETURNTRANSFER => true,
//CURLOPT_ENCODING => "",
CURLOPT_POSTREDIR => 3,
CURLOPT_HEADER => true,
//CURLOPT_MAXREDIRS => 10,
//CURLOPT_TIMEOUT => 30,
//CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POST => true,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_COOKIEFILE => "cookie.txt",
CURLOPT_COOKIEJAR => "cookie.txt",
CURLOPT_POSTFIELDS => $post,
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"Content-type: text/html; charset=UTF-8"
),
));
$response = curl_exec($curl);
$info = curl_getinfo($curl);
$err = curl_error($curl);
curl_close($curl);
return $response;
}
$p = array(
"user_session[username]"=>"[email protected]",
"user_session[password]"=>"Blablabla",
"commit"=>"Login",
"comeback"=>"%2F"
);
$login = curl("https://www.bukalapak.com/user_sessions", http_build_query($p));
echo $login;
?>
HTTP/1.1 302 Found Server: nginx Date: Fri, 03 Feb 2017 06:28:03 GMT Content-Type: text/html; charset=utf-8 Location: https://www.bukalapak.com/ Transfer-Encoding: chunked Connection: keep-alive Status: 302 Found Cache-Control: max-age=0, private, must-revalidate, no-transform X-We-Need-To-Talk: Hey, you need to check out https://www.bukalapak.com/careers :) Vary: Origin X-Permitted-Cross-Domain-Policies: none X-XSS-Protection: 1; mode=block X-Request-Id: 90f9ca9a-4ade-4c3d-a0ea-592effd5c2ee X-Download-Options: noopen X-Found-Something: Found any vulnerabilities in our system? https://www.bukalapak.com/bug_reports X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Set-Cookie: _mkra_ctxt=8891a37006424c9c608a41bf3f6558de--302; path=/; max-age=5; HttpOnly Set-Cookie: lskjfewjrh34ghj23brjh234=RjhGMUlkUEpHb0NOaTNLeUFoT2x2RmxZeWxDTWRySEV6aUc4a0tBOWhqbGdZVS9kWUlOZHFOSXNVZWt2UmJCTkFBRXZLVW8wd21rUktrYXZQR05lUU01aHRuemdzVi91WnFqcUFid2s0MVhUbGhmQXk0cGIrVU5iaXR3UW1HQ21LeHJHRHhMRGZucGo3UUluZ2FLbjJMSWZiZVExODgyRmtUQXJaMTZjYVQxMXZSOWg5U3FGeHZZTGdxVllNTFp4MGtDcnJiaEEwL0NkTVNNT2lTWE8yQXNtNEIzWTVKc0h4NVdVeEVKYnZMSVFMQ29KcysyUGdnK2VZaWNLaVozL3NXYzVIcXlHWkY4SDZESjF4RXp6ak5wVXVOeXRXdjZ0YkZ1UWhPQVJNcjA9LS1od2k3aTgzM3pBSEx5TDVqcE9ZWUZ3PT0%3D--0f995ca0f739bbb3f94b4e92b6628da326a2cb5c; domain=.bukalapak.com; path=/; HttpOnly Strict-Transport-Security: max-age=31536000; includeSubdomains You are being redirected.