php源码如图所示,记录浏览者ip,并写入log.txt,怎么弄?以下为源码<?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);?>
2016-06-07 08:48:20 ::1 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.19 Safari/537.36 http://localhost/test/ 这是我用的你的源码运行得到的,应该是没有问题的啊