$action = $_GET['action'];
if ($action == 'phpinfo')
{
phpinfo ();
return 1;
}
$reguptime = trim (exec ('uptime'));
if ($reguptime)
{
if (preg_match ('/, *(\\d) (users?), .*: (.*), (.*), (.*)/', $reguptime, $uptime))
{
$users[0] = $uptime[1];
$users[1] = $uptime[2];
$loadnow = $uptime[3];
$load15 = $uptime[4];
$load30 = $uptime[5];
}
}
else
{
$users[0] = 'Unavailable';
$users[1] = '--';
$loadnow = 'Unavailable';
$load15 = '--';
$load30 = '--';
}
$uptime = shell_exec ('cut -d. -f1 /proc/uptime');
$days = floor ($uptime / 60 / 60 / 24);
$hours = str_pad ($uptime / 60 / 60 % 24, 2, '0', STR_PAD_LEFT);
$mins = str_pad ($uptime / 60 % 60, 2, '0', STR_PAD_LEFT);
$secs = str_pad ($uptime % 60, 2, '0', STR_PAD_LEFT);
$phpver = phpversion ();
$mysqlver = mysql_get_client_info ();
$zendver = zend_version ();
echo '' . '