后台增加访问IP记录
parent
cf92ac52e3
commit
233e5dfed0
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
$title = '访问记录';
|
||||
include './head.php';
|
||||
?>
|
||||
|
||||
<main class="lyear-layout-content">
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><h4>当天访问记录:</h4></div>
|
||||
<div class="card-body">
|
||||
<?php
|
||||
//<div class="lyear-layout-content" id="main">
|
||||
$date = date("Y-m-d");
|
||||
$iptxt = "../include/IP/IP_".$date.".txt";
|
||||
//$about = 'about.txt';
|
||||
//本页内容请修改about.txt文件防止更新后index.php文件被覆盖
|
||||
|
||||
if(file_exists($iptxt)){
|
||||
//文件存在,直接输出文件内容
|
||||
echo file_get_contents($iptxt);
|
||||
}
|
||||
else {
|
||||
//文件不存在
|
||||
@file_put_contents($iptxt,'<h1>404</h1>');
|
||||
echo file_get_contents($iptxt);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<center><p class="footer"><?php echo $conf['copyright']?></p></center>
|
||||
|
||||
<?php
|
||||
include './footer.php';
|
||||
?>
|
@ -0,0 +1,36 @@
|
||||
<?php include("../../include/common.php"); ?>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>本站访问记录 - <?php echo explode("-", $conf['title'])[0];?></title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/docsify/4.12.2/themes/vue.min.css" type="text/css" rel="stylesheet">
|
||||
<style>body:not(.ready){overflow:auto!important}#main{max-width:90%}p.footer{margin-top:60px}p.footer a{text-decoration:none}</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="markdown-section" id="main">
|
||||
<h3>本站访问记录:</h3>
|
||||
<?php
|
||||
$date = date("Y-m-d");
|
||||
$iptxt = "IP_".$date.".txt";
|
||||
|
||||
//$about = 'about.txt';
|
||||
//本页内容请修改about.txt文件防止更新后index.php文件被覆盖
|
||||
|
||||
if(file_exists($iptxt)){
|
||||
//文件存在,直接输出文件内容
|
||||
echo file_get_contents($iptxt);
|
||||
}
|
||||
else {
|
||||
//文件不存在
|
||||
@file_put_contents($iptxt,'<h1>404</h1>');
|
||||
echo file_get_contents($iptxt);
|
||||
}
|
||||
?>
|
||||
|
||||
<center><p class="footer"><?php echo $conf['copyright']?></p></center>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue