PHP 文件记录访问者IP实例代码
来源:未知 责任编辑:智问网络 发表时间:2013-11-10 20:11 点击:次
php 文件记录访问者IP实例代码 ,代码很少,在PHP环境里可以运行,希望可以帮助有需要的人。
- <?php
- $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);
- ?>
相关新闻>>
- 发表评论
-
- 最新评论 更多>>