Log user ip address, date and time

前端 未结 5 517
别跟我提以往
别跟我提以往 2020-12-24 15:32

Is there a simple script or piece of code I can add to my page to keep a log of every visitor, the date and time they hit the page and IP address? And what would be the bes

5条回答
  •  情歌与酒
    2020-12-24 16:13

    here is my little script to log ip addresses dont forget to add the below after the /HEAD tag also note to make this work it must be a PHP not HTML

    
    

    where ever you want it called from

    "log-ip.php"


    "); fclose($fp); ?>

    and the resault is a nice web HTML log file logs/ip-address-mainsite.html

    
    
    
    
    NZ Quakes - Main Web Site Log
    
    
    
    
    
    
    NZ Quakes - Main Web Site Log

    [01/04/2017 08:25:21]: 124.197.9.181 /index.php Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36

    below is a picture of what it looks like.

    what do you think about this i think its clean and simple sort of.

提交回复
热议问题