PHP/¥µ¥ó¥×¥ë/¥¢¥¯¥»¥¹¥í¥°
Last-modified: 2018-11-14 (¿å) 15:23:57 (2214d)
¥¢¥¯¥»¥¹¥í¥°Äɵ¤ª¤è¤Óɽ¼¨¥µ¥ó¥×¥ë †
<html> <head><title>Access Log</title></head> <body> <?php define("LOG_FILE_NAME", "./log/accesslog.log"); print("<h1>Access Log</h1>\n"); print("now: " . date("Y-m-d H:i:s ") . "<br /><br />\n"); $fp = @fopen(LOG_FILE_NAME, "a+") or die("¥¨¥é¡¼¡§¥í¥°¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£" . LOG_FILE_NAME); flock($fp, LOCK_EX); fputs($fp, date("Y-m-d H:i:s ") . $_SERVER['REMOTE_ADDR'] . "\n"); flock($fp, LOCK_UN); rewind($fp); while (!feof($fp)) { $line = fgets($fp); print($line . "<br />"); } fclose($fp); ?> </body> </html>