加载此页面时,我会继续收到以下通知:
(!)注意:未定义索引:清除
我很感激您在清除此通知时提供任何帮助。
<?php require_once("../../includes/initialize.php"); ?>
<?php if (!$session->is_logged_in()) { redirect_to("login.php"); } ?>
<?php
$logfile = SITE_ROOT.DS.'logs'.DS.'log.txt';
if($_GET['clear'] == 'true') {
file_put_contents($logfile, '');
// Add the first log entry
log_action('Logs Cleared', "by User ID {$session->user_id}");
// redirect to this same page so that the URL won't
// have "clear=true" anymore
redirect_to('logfile.php');
}
?>
<h2>Log File</h2>
<p><a href="logfile.php?clear=true">Clear log file</a><p>