PHP file record visitor IP example code_PHP tutorial

WBOY
Release: 2016-07-13 17:40:40
Original
1230 people have browsed it

The php file records the visitor IP instance code. The code is very small and can be run in the PHP environment. I hope it can help those in need.

  1. $fp = fopen("log.txt","a ");
  2. fwrite($ fp,date("Y-m-d H:i:s"));
  3. fwrite($fp," ");
  4. fwrite($fp,$_SERVER[REMOTE_ADDR]);
  5. fwrite($fp," ");
  6. fwrite($fp,$_SERVER[HTTP_X_REWRITE_URL]);
  7. fwrite($fp," ");
  8. fwrite($fp,$_SERVER[HTTP_USER_AGENT]);
  9. fwrite($fp," ");
  10. fwrite($fp,$_SERVER["HTTP_REFERER"]);
  11. fwrite($fp," ");
  12. fclose($fp);
  13. ?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486190.htmlTechArticlephp file records the visitor IP example code. The code is very small and can be run in the PHP environment. I hope it can help someone. People who need it. ?php $fp = fopen("log.txt","a "); fwrite($fp,date("Y-m-d H...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!