[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: server up na stronie www



<?php
$uptime = exec("cat /proc/uptime");
$uptime = split(" ",$uptime);
$uptime = $uptime[0];
?>
<html>
<head>
<script language="javascript">
var upSeconds=<?php echo $uptime; ?>;
function doUptime() {
var uptimeString = "Server Uptime: ";
var secs = parseInt(upSeconds % 60);
var mins = parseInt(upSeconds / 60 % 60);
var hours = parseInt(upSeconds / 3600 % 24);
var days = parseInt(upSeconds / 86400);
if (days > 0) {
uptimeString += days;
uptimeString += ((days == 1) ? " day" : " days") + ", ";
}
if (hours > 0) {
uptimeString += hours;
uptimeString += ((hours == 1) ? " hour" : " hours") + ", ";
}
if (mins > 0) {
uptimeString += mins;
uptimeString += ((mins == 1) ? " minute" : " minutes") + ", ";
}
uptimeString += secs;
uptimeString += ((secs == 1) ? " second" : " seconds");
uptime.innerHTML = uptimeString;
upSeconds++;
setTimeout("doUptime()",1000);
}
</script>
</head>
<body onLoad="doUptime();">

<div id="uptime" style="font-weight:bold;">&nbsp;</div>

</body>
</html>


--
Z poważaniem,
Paweł Lalewicz
_____________________________________
GG:39211 GSM: +48 510 808 000
ICQ:78825643 e-mail: i-pawelek@tlen.pl
Tlen: i-pawelek Skype: i-pawelek
IRC: Pawelek_ (IRCnet)
=====================================
Amatorska Sieć Komputerowa oś. Ślichowice Kielce, POLAND
ASK slichoWice.pl - http://www.slichoWice.pl





Reply to: