嗨,我有远程登录代码并尝试连接到我的目标站点,但我不能。
$url="http://hipfile.com";
$postdata = "login=bnnoor&password=########&op=login";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_REFERER, $url);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
$result = curl_exec ($ch);
if (!$result) {
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch); // make sure we closeany current curl sessions
die($http_code.' Unable to connect to server. Please come back later.');
}
echo $result;
curl_close($ch);
网站中的登录表单是
<form method="POST" action="http://hipfile.com/" name="FL">
<input type="hidden" name="op" value="login">
<input type="hidden" name="redirect" value="http://hipfile.com/">
<div class="clear span-5">Username: <input type="text" name="login" value="bnnoor" class="myForm"></div>
Password: <input type="password" name="password" class="myForm">
<input type="image" style="height: 34px; padding-left:10px; padding-bottom: 3px; vertical-align: middle;" src="http://hipfile.com/images/login.png"> <a href="http://hipfile.com/?op=forgot_pass">Forgot your password?</a><br>
</form>
但我无法访问我在站点中的文件,并且在开始页面重定向到站点中的登录页面后?请帮助我。