如何在PHP中卷曲uploadrocket
作者:互联网
我正在尝试卷曲http://uploadrocket.net/?op=checkfiles的结果,并使用curl获得文件大小的结果.
我尝试了以下方法:
function curl($url,$cookies,$post,$header=1) {
$ch = @curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, $header);
if ($cookies) curl_setopt($ch, CURLOPT_COOKIE, $cookies);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER,$url);
if ($post) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 20);
$page = curl_exec( $ch);
curl_close($ch);
return $page;
}
$link = "http://uploadrocket.net/rlajq9dwrxey.htm";
$page = curl('http://uploadrocket.net/?op=checkfiles',"",'list='.urlencode($link).'&process=Check%20URLs');
echo $page;
但它不起作用.
提前致谢
解决方法:
$page = file_get_contents(‘http://uploadrocket.net/?op=checkfiles/links=‘.$link.’& process =检查URL’);
标签:file-get-contents,curl,php 来源: https://codeday.me/bug/20191120/2044816.html