download this file: pinfo.php view text/plain: pinfo.php file encoding: UTF-8 [goback]
<?php
##
## http://www.php.net/manual/en/function.phpinfo.php
## http://www.michael-berndt.de/ie/phpinfo/colour.php
##
## example :
## $config = array('line'=>'#404387','th'=>'#8899CC','tr'=>'#DCEDFE','td'=>'#B9CCEE');
## _phpinfo(-1,$config);
##
function _phpinfo($what=-1, $config=array())
{
ob_start();
if(!@phpinfo(!$what ? -1 : $what))
{
ob_end_clean();
return 0;
}
$phpinfo = ob_get_contents();
ob_end_clean();
## for PHP/4.3.3
##
$deltag = array
(
';</?(!DOCTYPE|HTML|HEAD|META|BODY)[^>]*>;i',
';<TITLE[^>]*>.*</TITLE>;i',
';^(BODY|TABLE|HR)[^{]+\{[^}]+\}\s*$;mi',
';^TD,\s*TH\s*\{;mi',
';^\.(E|H|V)\s+\{;mi',
';^IMG\s+{;mi',
';<img\s+border=;i',
';(<tr\s+class="(h|v)">\s*<td)>;i',
'/background-color: #fff;/i',
);
$phpinfo = preg_replace
($deltag,array
(
'',
'',
'',
'th, {',
'.\1 { border: 1px solid #000000; ',
'.img {',
'<img class="img" border=','\1 class="\2">',
'',
''),
$phpinfo
);
if(!$config)
{ $config = array('line'=>'#000000','th'=>'#9999CC','tr'=>'#CCCCCC','td'=>'#CCCCFF'); }
$from = array(';LS_COLORS(.*)>([^>]+)</td>;i',';(/usr/local/bin:);','|(text/plain;)|i',
'/#000000/','/#9999cc/','/#cccccc/','/#ccccff/');
$to = array('LS_COLORS\1> </td>','\1<BR>','\1<BR>',
$config['line'],$config['th'],$config['tr'],$config['td']);
$phpinfo = preg_replace($from,$to,$phpinfo);
echo '<STYLE TYPE="text/css"><!-- td, th { font-size:9pt; } --> </STYLE>';
echo "\n\n$phpinfo";
return 1;
}
global $_admin_ips; // bug
$docroot ??= $_SERVER['DOCUMENT_ROOT'];
require_once $docroot.'/_conf/adminconf.php';
require_once $docroot.'/_conf/htmlconfig.php';
require_once $docroot.'/_lib/func.globals.php';
realuri(dirname(__FILE__));
$config = array('line'=>'#404387','th'=>'#8899CC','tr'=>'#DCEDFE','td'=>'#B9CCEE');
if(!in_array($_SERVER['REMOTE_ADDR'],$_admin_ips))
{
//$_SERVER['SERVER_ADDR'] = '_';
$_SERVER['SERVER_SOFTWARE'] = '_';
}
echo "</DIV>\n";
if(!_phpinfo(-1,$config))
{
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
}
echo "<DIV ALIGN='".$_html['align']."'>\n";
?>