Location: PHPKode > projects > Trunk.net > uptime.php
<?

/*Script by CoLdFuSiOn 27/02/2004 ver. 2 heehee
You can of course use this script in any page other than a BT site
as long as it is using windows and php!
replace this routine in index.php toward the bottom
<h2>Uptime</h2>
<table width=100% border=1 cellspacing=0 cellpadding=10><tr><td align=center>
<? print(trim(exec('uptime'))); ?>
</td></tr></table>

and replace it with

<h2>Uptime</h2>
<table width=100% border=1 cellspacing=0 cellpadding=10><tr><td align=center>
<? include ("uptime.php"); ?>
</td></tr></table>*/



    $server = "Torrents.idle.ro";                 //Change this to your server name or website title.
    $testtime= filemtime("D:/Xampp/xampp/Apache/logs/httpd.pid");   // Change this to a file that is only run once during webserver startup, I suggest the http.pid if you have apache, or if IIS you'll have to experiment with different files as I don't know much about it.
    $up = time() - $testtime;
    $days = floor($up / 86400);
    $up -= ($days * 86400);
    $hours = floor($up / 3600);
    $up -= ($hours * 3600);
    $minutes = floor($up / 60);
    $up -= ($minutes * 60);
    $seconds = $up;


    echo $server." Uptime: ";

	if ($days==1){
	echo $days." day, ";
}else{
		echo $days." days, ";
}

    if ($hours==1){
	echo $hours." hour, ";
}else{
		echo $hours." hours, ";
}
    if ($minutes==1){
	echo $minutes." minute and ";
}else{
		echo $minutes." minutes and ";
}

    if ($seconds==1){
	echo $seconds." second";
}else{
		echo $seconds." seconds";
}

?>
	<br>Tracker Load: (1 %)
			<table class=main border=0 width=400>
			<tr>
				<td style='padding: 0px; background-image: url(pic/loadbarbg.gif); background-repeat: repeat-x'>
				<img height=15 width=5.88 src="pic/loadbargreen.gif" alt='1.03%'>
				</td>
			</tr>
			</table>
			<br>				</td>
			</tr>
			</table>
Return current item: Trunk.net