Code had two file connections use one.
Noticed there were two open connection for the file log. A few other adjustments.
This commit is contained in:
parent
bc2b14739c
commit
2900b9fb1b
|
|
@ -107,9 +107,9 @@
|
|||
$file_size = filesize($log_file);
|
||||
}
|
||||
|
||||
//read the log
|
||||
//open the log file
|
||||
if (file_exists($log_file)) {
|
||||
$file_handle = fopen($log_file, "r");
|
||||
$file = fopen($log_file, "r") or exit($text['error-open_file']);
|
||||
}
|
||||
|
||||
//include the header
|
||||
|
|
@ -197,6 +197,8 @@
|
|||
$array_filter[6]['type'] = 'bold';
|
||||
$array_filter[6]['font'] = 'monospace';
|
||||
|
||||
$file_size = filesize($log_file);
|
||||
|
||||
/*
|
||||
// removed: duplicate of above
|
||||
if (isset($_POST['submit'])) {
|
||||
|
|
@ -243,8 +245,8 @@
|
|||
else {
|
||||
//open the file
|
||||
$byte_count ='0';
|
||||
if ($file_handle) {
|
||||
fseek($file_handle, 0);
|
||||
if ($file) {
|
||||
fseek($file, 0);
|
||||
}
|
||||
echo "<br>".$text['label-open_file']."<br>";
|
||||
}
|
||||
|
|
@ -267,9 +269,9 @@
|
|||
|
||||
//start processing
|
||||
$byte_count = 0;
|
||||
if ($file_handle) {
|
||||
while(!feof($file_handle)) {
|
||||
$log_line = escape(fgets($file_handle));
|
||||
if ($file) {
|
||||
while(!feof($file)) {
|
||||
$log_line = escape(fgets($file));
|
||||
$byte_count++;
|
||||
$noprint = false;
|
||||
|
||||
|
|
@ -337,8 +339,8 @@
|
|||
require_once "resources/footer.php";
|
||||
|
||||
//close the file
|
||||
if ($file_handle) {
|
||||
fclose($file_handle);
|
||||
if ($file) {
|
||||
fclose($file);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue