Home  >  Article  >  Backend Development  >  PHP prohibits using download tools to download files

PHP prohibits using download tools to download files

WBOY
WBOYOriginal
2016-07-25 08:45:221793browse
  1. if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 8.0"))
  2. echo "Internet Explorer 8.0"; // 这里可以写其他的执行命令
  3. else if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 7.0"))
  4. echo "Internet Explorer 7.0";
  5. else if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 6.0"))
  6. echo "Internet Explorer 6.0";
  7. else if(strpos($_SERVER["HTTP_USER_AGENT"],"Firefox/3"))
  8. echo "Firefox 3";
  9. else if(strpos($_SERVER["HTTP_USER_AGENT"],"Firefox/2"))
  10. echo "Firefox 2";
  11. else if(strpos($_SERVER["HTTP_USER_AGENT"],"Chrome"))
  12. echo "Google Chrome";
  13. else if(strpos($_SERVER["HTTP_USER_AGENT"],"Safari"))
  14. echo "Safari";
  15. else if(strpos($_SERVER["HTTP_USER_AGENT"],"Opera"))
  16. echo "Opera";
  17. else echo $_SERVER["HTTP_USER_AGENT"];
  18. ?>
复制代码

  1. if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE"))echo"禁止用IE浏览器或其他下载工具下载";
  2. else header("Content-Disposition: attachment; filename='jquery.js'");//写上文件名
  3. ?>
复制代码

php


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn