Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2005-08-14, 02:18 PM
Junior Member
 
Join Date: Aug 2005
Posts: 2
Prevost
Default

Ive developed an extremely simple PHP code that echo's the uptime of the server, which im sure is in seconds.

Here's the code:

Code:
<?php
$uptime = exec("cat /proc/uptime");
$uptime = split(" ",$uptime);
$uptime = $uptime[0];
?>
<html>
<body>
<font face="verdana" size="1pt">
Uptime For This Month = <b><?php echo $uptime; ?></b>
</font>
</html>
However, i need to further develop this code to make it complete, and im a novice at PHP.

Could anyone help me? I need it to echo the uptime for that monthly ONLY and in a percentage. Could anyone help me?

thanks in advance!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2005-08-14, 02:37 PM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

Uptime only gives you how long it has been up since its last downtime, so this is not going to be accurate for what you are trying to do.

You will need a script that runs at intervals and checks times, then just compare the seconds against how many seconds there are in a month, thus your percentage.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #3 (permalink)  
Old 2005-08-14, 03:04 PM
Junior Member
 
Join Date: Aug 2005
Posts: 2
Prevost
Default

How much do you think it would cost to get a code like this developed?
Reply With Quote
  #4 (permalink)  
Old 2005-08-15, 10:44 AM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

depends on who writes it.

There are several free ones out there though, check out hotscripts.com
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:50 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.