2016-02-26 238 views
1

我試圖創造條件,能夠給我登錄到ROBLOX帳戶cURL不顯示,不能正常工作?

這個功能是我創建的代碼,並試圖

<?php 
    $ch = curl_init('http://www.roblox.com/newlogin'); 
    curl_setopt($curl, CURLOPT_POST, 1); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
     username => 'Username', 
     password => '#######', 
     submitLogin => 'Log In' 
    )); 

    $result = curl_exec($ch); 
    echo($result); 
    ?> 

唯一的問題是,它不登錄我,也輸出目標遷至此地

Object moved Here

是否有任何理由爲什麼會失敗登錄我?以及爲什麼對象移動到這裏而不是ROBLOX的newlogin頁面?

這裏是所需的信息,如果你想

Request URL:https://www.roblox.com/newlogin 
Request Method:POST 
Status Code:302 Found 
Remote Address:8.42.96.39:443 
Response Headers 
view source 
Access-Control-Allow-Credentials:true 
Access-Control-Allow-Origin:https://www.roblox.com 
Access-Control-Expose-Headers:X-CSRF-TOKEN 
Cache-Control:private 
Content-Length:130 
Content-Type:text/html; charset=utf-8 
Date:Fri, 26 Feb 2016 10:15:03 GMT 
Location:/home?nl=true 
P3P:CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE" 
Set-Cookie:.ROBLOSECURITY=_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_C1183ACB7F4DF9061B7F4E0CF17A7E5A6556D75C4B3B05467092952A6A2554429AC0FE5A24B70282702CE582A8AC040790564311FF4F47841B87D9DE5BB613DF7B564B39F6D65E4A53991E42463BFE959E5E7C638FD204F81F9A5F1A08D208DB5D662DAC02D7F09E1F689E055053866CB4794C56F18C0FE372469732888A0F8FCDC8704319BBBDAFFD0D98243681A912872AF00218773E150788096CFBAB158A1176D65A5BE24896064903CFB77318EB8875351072CE35CB059641BB986038C9AC5863D11206E330A2FC27DC62E55D65EA032A1790331B86BC9B5352EAB131321FFE94599005693977C5E2A054CF6945FF8D325443103AFE414369EF5564E5C65A76A2E8A8EE9CC4E8546E9098FF6768A4A6A88215F23CBCBF6227A34BE0C2DBFE9F4802058419E614CE30FA52486789F0E86FE5B45E1C66D3A47B3F695A4DDCDC6B3EB3BEC4731C09BEC3188E5AD456599AFB18884828064D131E7004F054298D5EE3FC144F8; domain=.roblox.com; expires=Sun, 27-Mar-2016 10:15:03 GMT; path=/; HttpOnly 
Request Headers 
view source 
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 
Accept-Encoding:gzip, deflate 
Accept-Language:en-US,en;q=0.8 
Cache-Control:max-age=0 
Connection:keep-alive 
Content-Length:59 
Content-Type:application/x-www-form-urlencoded 
Cookie:RBXSource=rbx_acquisition_time=2/17/2016 11:34:48 AM&rbx_acquisition_referrer=&rbx_medium=Direct&rbx_source=&rbx_campaign=&rbx_adgroup=&rbx_keyword=&rbx_matchtype=&rbx_send_info=1; RBXViralAcquisition=time=2/17/2016 11:34:48 AM&referrer=&originatingsite=; GuestData=UserID=-1661021767; RBXMarketing=FirstHomePageVisit=1; __gads=ID=85bb563f4079b12f:T=1455730802:S=ALNI_MbDjPeXjVm69YJMcFdVnOyw2XxWvQ; __ssid=aaf89930-bda3-4057-9fed-d5324ec16615; __RequestVerificationToken=NnycdFxv3QtmdyJPW9irh64pVurQGL4BHEjZI9kq3uET0G_NT_f0JUQlIhVsE6gUC5clWd4QoPQ3gwwDo45kif1JQHw1; glt_3_OsvmtBbTg6S_EUbwTPtbbmoihFY5ON6v6hbVrTbuqpBs7SyF_LQaJwtwKJ60sY1p=LT3_p97tsEiCJbASoKTsdz1ye4a8igDizZThXseKb-HwEYg%7CUUID%3D4169b82697734de882c125e3b3e4bc17; _gig_llp=facebook; _gig_llu=Baheeg; RBXEventTrackerV2=CreateDate=2/26/2016 4:01:29 AM&rbxid=96092679&browserid=4151477874; rbx-ip=; __qca=P0-1972999082-1456481070051; RBXImageCache=timg=62646533346162632D643361312D343366392D396536622D386432646561316636313662253130392E3137372E32382E32323425322F32362F3230313620393A35313A353820414D534CED27903239AA1175AB86097D565F4BC07C53; __utmt_b=1; __utma=200924205.672426321.1455730486.1456473772.1456480004.45; __utmb=200924205.66.7.1456481717857; __utmc=200924205; __utmz=200924205.1456426636.42.6.utmcsr=forum.roblox.com|utmccn=(referral)|utmcmd=referral|utmcct=/Forum/ShowPost.aspx 
Host:www.roblox.com 
Origin:https://www.roblox.com 
Referer:https://www.roblox.com/newlogin 
Upgrade-Insecure-Requests:1 
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36 
Form Data 
view source 
view URL encoded 
Username:######## 
Password:######## 
ReturnUrl: 

注:這不是惡意使用

回答

0

你沒問卷曲跟隨重定向。 CURLOPT_FOLLOWLOCATION

你可能還需要啓用Cookie以便正確的設定是在傳遞重定向消息請求。

+0

想我做到了,謝謝,但如何將我的經歷,餅乾的話題? – SomeDev

+0

你加入到我的回答評論一個新的問題......但看到CURLOPT_COOKIEFILE和CURLOPT_COOKIEJAR。 –

+0

謝謝!真的很感激它 – SomeDev