I continue to get the following notice when I load this page.:
(!)Notice: Undefined index: clear
I'd appreciate any assistance in clearing this notice.
<?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>