douhaoqiao9304 2014-10-08 13:05
浏览 188

get_headers()检查站点是否在线有多可靠? [关闭]

How reliable is get_headers() for checking if a site is online?

Basically:

    $check = get_headers($url,1);

So again how reliable is it and can I depend on its accuracy?

  • 写回答

1条回答 默认 最新

  • dtgv52982 2014-10-08 13:40
    关注

    If you want to use the results of get_headers() for input to any other function I would not count on 100% accuracy. If you want to look at the results with your own eyes (like I do) and fix or check any discrepancies yourself, then this will be fine.

    The results can be effected by a number of things for both get_headers() and cURL. Personally I run cURL against an array of all the websites I manage at least once a day while I am at work and typically I get a few false negatives. I used to use the get_headers() method, but in terms of false negatives I didn't notice any difference. The reason I switched to cURL was it gave better options in terms of returning error messages etc.

    NOTE: If, like me, you are running this against an array of sites you manage I should point out that on many occasions this approach has caused me to get sucked into the blacklist from my hosting provider because I was running this at the same time that they were detecting a brute force attack from elsewhere. Some phone calls to tech support and after a few weeks they began recognize me when I called... not a good thing.

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!