duan0504
2015-03-30 13:14
浏览 50
已采纳

如何在PHP中卷曲uploadrocket

i'm trying to curl the result of http://uploadrocket.net/?op=checkfiles and get the filesize result using curl.

i have tried the following:

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;

but it's not working.

Thanks in advance

图片转代码服务由CSDN问答提供 功能建议

我正在尝试卷曲 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);  
返回$ page; 
} 
 
 $ link =“http://uploadrocket.net/rlajq9dwrxey.htm";
nnpage = curl('http://uploadrocket.net/?op  = checkfiles',“”,'list ='。urlencode($ link)。'& process = Check%20URLs'); 
 
echo $ page; 
   
 
  

但它不起作用。

提前致谢

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • doujiaoang69440 2015-03-30 14:18
    已采纳

    $page = file_get_contents('http://uploadrocket.net/?op=checkfiles/links='.$link.'&process=Check%20URLs');

    评论
    解决 无用
    打赏 举报
查看更多回答(1条)

相关推荐 更多相似问题