Home  >  Article  >  Backend Development  >  PHP code to determine whether the user is using a proxy

PHP code to determine whether the user is using a proxy

WBOY
WBOYOriginal
2016-07-25 08:42:261332browse
  1. /*****************************************************
  2. *
  3. * isProxy
  4. * check whether client is under Proxy or not
  5. * $_SERVER['HTTP_X_FORWARDED_FOR'] is pivotal here
  6. * if client is under Proxy, returns true
  7. * if client is not under Proxy, returns false
  8. *
  9. *****************************************************/
  10. function isProxy(){
  11. return (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? true : false;
  12. }
  13. ?>
Copy code

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