server uptime on page

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
crs992
-


Joined: 15 Jun 2005
Posts: 32

PostPosted: Sat Mar 04, 2006 12:27 am    Post subject: server uptime on page Reply with quote

how do you show the server uptime on you home page using php or cgi?
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sat Mar 04, 2006 1:43 am    Post subject: Reply with quote

I use php.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
crs992
-


Joined: 15 Jun 2005
Posts: 32

PostPosted: Sat Mar 04, 2006 2:03 am    Post subject: Reply with quote

how would you do this?
_________________
http://crs992.bounceme.net:8080/
Back to top View user's profile Send private message Visit poster's website
NickC
-


Joined: 02 Mar 2006
Posts: 6

PostPosted: Sat Mar 04, 2006 4:09 am    Post subject: Reply with quote

I guess you'd parse the persist.data file in Abyss's directory to find the <uptime> and <since> info, then format it and output it.

Seems reasonable, but I don't work for Aprelium.
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sat Mar 04, 2006 5:30 am    Post subject: Reply with quote

Read the Abyss Web Server Documentation on "CGI Environment Variables" and
you will find some pretty nice information. Your answer is in that section. LateR!

In a PHP script, use the following code to find them. X_ABYSS etc.

Code:

<?php
 phpinfo();
?>


Sincerely, TRUSTpunk
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sat Mar 04, 2006 10:59 am    Post subject: Reply with quote

You can use PHP to get the actual PC uptime or you can use an SSI to get Abyss's uptime.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
crs992
-


Joined: 15 Jun 2005
Posts: 32

PostPosted: Sat Mar 04, 2006 2:21 pm    Post subject: Reply with quote

does anyone have a script that i may use written in php or an example on how to do this?
_________________
http://crs992.bounceme.net:8080/
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sat Mar 04, 2006 2:38 pm    Post subject: Reply with quote

Code:

<?php

$pagefile = "C:\pagefile.sys";

$uptime = (time() - filemtime($pagefile));
$updays = floor($uptime / (24*3600));
$uptime = $uptime - ($updays * (24*3600));
$uphours = floor($uptime / (3600));
$uptime = $uptime - ($uphours * (3600));
$upminutes = floor($uptime /(60));
$uptime = $uptime - ($upminutes * 60);
$upsecs = $uptime;

?>

<table border="0" align="center">
<tr>
<td><font size="1" face="tahoma"><b>Server Uptime:</b> <?php echo($updays); ?>d, <?php echo($uphours); ?>h, <?php echo($upminutes); ?>m, <?php echo($upsecs); ?>s
</table>

_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
crs992
-


Joined: 15 Jun 2005
Posts: 32

PostPosted: Sat Mar 04, 2006 2:54 pm    Post subject: Reply with quote

thank you for the help!
_________________
http://crs992.bounceme.net:8080/
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group