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.
- $fp = fopen("log.txt","a ");
- fwrite($ fp,date("Y-m-d H:i:s"));
- fwrite($fp," ");
- fwrite($fp,$_SERVER[REMOTE_ADDR]);
- fwrite($fp," ");
- fwrite($fp,$_SERVER[HTTP_X_REWRITE_URL]);
- fwrite($fp," ");
- fwrite($fp,$_SERVER[HTTP_USER_AGENT]);
- fwrite($fp," ");
- fwrite($fp,$_SERVER["HTTP_REFERER"]);
- fwrite($fp,"
");
- fclose($fp);
- ?>
-
http://www.bkjia.com/PHPjc/486190.htmlwww.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...
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