PHP file record visitor IP instance code _ PHP Tutorial

Source: Internet
Author: User
The PHP file records the visitor's IP address instance code. The PHP file records the visitor's IP address instance code. the code is very small and can be run in the PHP environment. hope to help people who need it .? Php?fpfopen(log.txt, a); fwrite ($ fp, date (Y-m-dH php file records the visitor's IP instance code, the code is very small, can be run in the PHP environment, hope to help people in need.

  1. $ Fp = fopen ("log.txt", "");
  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. ?>


Http://www.bkjia.com/PHPjc/486190.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/486190.htmlTechArticlephp files record visitor IP instance code, code is very few, can run in PHP environment, hope to help people in need. ? Php $ fp = fopen ("log.txt", "a"); fwrite ($ fp, date ("Y-m-d H...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.