hey another thingy i cant think a way of solving it...
i have this code:
<?php
$pagefile = 'c:pagefile.sys'; // Path to system pagefile. Default is c:\pagefile.sys
function ifif ($value, $true, $false) {
if ($value == 0)
{ return $false; }
else
{ return $true; }
} //End function
$upsince = filemtime($pagefile);
$gettime = (time() - filemtime($pagefile));
$days = floor($gettime / (24 * 3600));
$gettime = $gettime - ($days * (24 * 3600));
$hours = floor($gettime / (3600));
$gettime = $gettime - ($hours * (3600));
$minutes = floor($gettime / (60));
$gettime = $gettime - ($minutes * 60);
$seconds = $gettime;
$days = ifif($days != 1, $days . ' days', $days . ' day');
$hours = ifif($hours != 1, $hours . ' hours', $hours . ' hour');
$minutes = ifif($minutes != 1, $minutes . ' minutes', $minutes . ' minute');
$seconds = ifif($seconds != 1, $seconds . ' seconds', $seconds . ' second');
echo '<b>Server uptime:</b> '.$days.' '.$hours.' '.$minutes.' '.$seconds.'. :: <b>Online since:</b> ' . date('l. F jS, Y. h:i a', $upsince); ?>
This piece is for a windows server, i dont know exactly what it does on linux but i figure it misses his pagefile and wont work therefor!
Anyway. what im wondering is can i keep a uptime record of this thing without altering it to much... so that it ALSO shows a longest uptime ever... like its online for 2 weeks then i restart it and it telle the visitor that the longest uptime is 2 weeks. and if that 'record' is broken it updates to the new uptime...
i figured it must store atleast a date or something to remember the longest uptime i think a simple txt file would do the trick or even a db? (i have a sql4 server) but when it comes to db i think its a hell of a lot work... how can i just extract the longest uptime and put it in a text file? I think its not that hard but i cant think of a reasonable way to do it 🙁 unfortunatly :rolleyes:
Thanks alot in advance!