Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/249.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在php中避免/停止这种类型的页面_Php_Curl - Fatal编程技术网

如何在php中避免/停止这种类型的页面

如何在php中避免/停止这种类型的页面,php,curl,Php,Curl,我使用以下功能来使用下载页面进行分析,它工作得非常完美 function gdll($target_url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0'); curl_setopt($ch, CURLOPT_URL,$target_url); curl_setopt($ch, CURLOPT_

我使用以下功能来使用下载页面进行分析,它工作得非常完美

function gdll($target_url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0');
curl_setopt($ch, CURLOPT_URL,$target_url);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$html= curl_exec($ch);

if (!$html) {
    echo "<br />cURL error number:" .curl_errno($ch);
    echo "<br />cURL error:" . curl_error($ch);
    exit;
}
return $html;
}

echo $data=gdll($url);
警告:如果打开此url,它将挂起浏览器并生成

Warning: opendir(/home/woo55555/public_html/adata/6129) [function.opendir]: failed to open dir: No such file or directory in /home/woo55555/public_html/play.php on line 71

Warning: readdir() expects parameter 1 to be resource, boolean given in /home/woo55555/public_html/play.php on line 72

Warning: readdir() expects parameter 1 to be resource, boolean given in /home/woo55555/public_html/play.php on line 72

Warning: readdir() expects parameter 1 to be resource, boolean given in /home/woo55555/public_html/play.php on line 72
并继续生成直线,使其无限大


现在我的问题是如何避免这种类型的URL我可以检查此页面的任何方法都有问题我的代码忽略然后继续下一个链接

可能限制下载大小,如本文所述:问题是该文件不存在还是属于某种类型的文件?上面的评论让我想到,如果我得到了可靠的结果,我会非常高兴solution@user3718334-我们不会为您编程。如果您有任何特定的编程问题,我们将帮助您解决。如果上面的评论对你有帮助,请尝试用你的努力更新你的问题。我只需要知道我在尝试我自己,如果我成功了,我会更新
Warning: opendir(/home/woo55555/public_html/adata/6129) [function.opendir]: failed to open dir: No such file or directory in /home/woo55555/public_html/play.php on line 71

Warning: readdir() expects parameter 1 to be resource, boolean given in /home/woo55555/public_html/play.php on line 72

Warning: readdir() expects parameter 1 to be resource, boolean given in /home/woo55555/public_html/play.php on line 72

Warning: readdir() expects parameter 1 to be resource, boolean given in /home/woo55555/public_html/play.php on line 72