Brian_Furious

Server Updatime basic

Apr 4th, 2012
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Your title</title>
  4. </head>
  5. <body>
  6. <div>The current uptime of "hostname/domain here" (IP here) is:</div>
  7. <?php
  8.  $buh = strtok( exec( "cat /proc/uptime" ), "." );
  9.  $days = sprintf( "%2d", ($buh/(3600*24)) );
  10.  $hours = sprintf( "%2d", ( ($buh % (3600*24)) / 3600) );
  11.  $min = sprintf( "%2d", ($buh % (3600*24) % 3600)/60 );
  12.  $sec = sprintf( "%2d", ($buh % (3600*24) % 3600)%60 );
  13.  
  14. echo "$days days, $hours hours, $min minutes, $sec seconds";
  15. ?>
  16. <p></p>
  17. <?php
  18. $hst = $_SERVER["HTTP_HOST"];
  19. $uri = $_SERVER["REQUEST_URI"];
  20. $rmt = $_SERVER["REMOTE_ADDR"];
  21. $br = $_SERVER["HTTP_USER_AGENT"];
  22. echo "Your IP address reflects as : $rmt \n<br>\n The page you requested was: $uri \n<br>\n The browser you are using is $br";
  23. ?>
  24. <p></p>
  25. <div>PHP Info: <a href="path to your phpinfo file ">phpinfo</a></div>
  26. </body>
  27. </html>
Advertisement
Add Comment
Please, Sign In to add comment