有没有办法卷曲登录这个网站?

时间:2013-09-22 12:00:05

标签: php curl login libcurl

我正在努力卷曲登录这个网站:http://downitfaster.com/但我甚至不能说我已经接近了。

我的代码:

$data = $this->curl("http://downitfaster.com/api/login.php","","textLogin=".$user."&textPassword=".$pass."&btnLogin=submit");

$data = $this->lib->curl("http://downitfaster.com/api/login.php", "textLogin={$user}&textPassword={$pass}&op=submit");

这是表单代码:

<form class="navbar-form pull-right" onsubmit="return false;" style="padding-bottom: 15px;">
                <div style="margin-top: 5px;">

                      <input id="textLogin" type="text" class="input-medium" style="height: 17px; font-size: 12px; margin-top: 5px;" placeholder="Username">
                      <input id="textPassword" type="password" class="input-medium" style="height: 17px; font-size: 12px; margin-top: 5px;" placeholder="Password">
                      <button id="btnLogin" type="submit" class="btn btn-small btn-link" data-loading-text="Loading..." style="margin-top:3px; color: #ffffff; background-color: #2C7FA8; ">Sign In</button>
                      <button id="btnSignup" type="button" class="btn btn-small btn-link" style="margin-top:3px; color: #ffffff; background-color: #C06C56; ">Sign Up</button>
                </div>
                <div style="float: right; margin-top: 2px;"><a href="#" style="color: #fff; font-size: 12px;" id="btnReminder">I forgot my password</a></div>
           </form>

提前致谢

1 个答案:

答案 0 :(得分:0)

这样的东西?

$urltopost = "http://downitfaster.com/api/login.php";
$datatopost = array (
"login" => "user",
"password" => "pass"
);

$ch = curl_init ($urltopost);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $datatopost);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$returndata = curl_exec ($ch);
相关问题