Quick and Dirty File Tail in PHP
June 18, 2008 – 10:25 amVery, very insecure.
$base_dir = "/var/log/sxr"; $to_tail = 25; $full_path = $base_dir . '/' . $file; if($count < $to_tail) { $to_tail = $count; } $start = $count - $to_tail; print = "Last $to_tail lines of $file<br/><br/>"; while($start < $count) { $start++; }

Sorry, comments for this entry are closed at this time.