Location: PHPKode > projects > Article System > include/modules/admin/include/info.php
<?php

/*
 *	Article System
 *	Online journal management tool written in PHP/MySQL/PostgreSQL.
 *	This code is available at http://sourceforge.net/projects/artsys
 *
 *	Copyright (C) 2001-2005 Jan Hnatek
 *	Distributed under the terms of the GNU General Public License
 *
 *	Date:	  05/08/2005
 *	Version:  0.6   	
 */

###############################################################################
# ADMIN PART
# admin information page
#

	// TODO: style fixes
	function adm_info ($text) {	echo "<p class=\"head2\">$text: </p>\n";	}
	function ainfo ($text) {	echo $text.'<br>';	}
	function aalert ($text) {	echo '<span style="color: red">'.$text.'</span><br>'; 	}

###############################################################################

	adm_info ("host system information");
	// **********************************
	echo "PHP version: ", phpversion (), "<br>";
	//echo "&nbsp;&nbsp; register_globals: ", ini_get ('register_globals'), "<br>";
	echo "database engine: ", $config["db_type"], "<br>";
	if ($config["db_type"] == "mysql") {
		echo "&nbsp;&nbsp; {$config["db_type"]} server version: ", mysql_get_server_info(), "<br>";
		echo "&nbsp;&nbsp; {$config["db_type"]} client version: ", mysql_get_client_info(), "<br>";
		echo "&nbsp;&nbsp; {$config["db_type"]} host : ", mysql_get_host_info(), "<br>";
		echo "&nbsp;&nbsp; {$config["db_type"]} protocol: ", mysql_get_proto_info(), "<br>";
  	} elseif ($config["db_type"] == "postgres") {
		//echo "&nbsp;&nbsp; {$config["db_type"]} server version: ", mysql_get_server_info(), "<br>";
		//echo "&nbsp;&nbsp; {$config["db_type"]} client version: ", mysql_get_client_info(), "<br>";
		echo "&nbsp;&nbsp; {$config["db_type"]} host : ", pg_host(), "<br>";
		//echo "&nbsp;&nbsp; {$config["db_type"]} protocol: ", mysql_get_proto_info(), "<br>";
		echo "&nbsp;&nbsp; {$config["db_type"]} client encoding : ", pg_client_encoding(), "<br>";
	}
	echo "<br>";
	$http_vars = array (
		'SERVER_NAME',			'SERVER_SOFTWARE',
		'SERVER_PROTOCOL',		'REQUEST_METHOD',
		'HTTP_HOST',			'HTTP_ACCEPT_CHARSET',
		'HTTP_ACCEPT_ENCODING',	'HTTP_ACCEPT_LANGUAGE',
		'HTTP_CONNECTION',
	);
	foreach ($http_vars as $tmp)
		if (isset ($_SERVER[$tmp]))
			echo strtolower ($tmp), ": ", $_SERVER[$tmp], "<br>";

	adm_info ("user network information");
	// ***********************************
	echo "remote address: ", $_SERVER['REMOTE_ADDR'], "<br>";
	echo "session saved address: ", $session_data['ip'], "<br>";
	echo "host: ", gethostbyaddr ($_SERVER['REMOTE_ADDR']), "<br>";
	$list = gethostbynamel (gethostbyaddr ($_SERVER['REMOTE_ADDR']));
	echo "list of user addresses: ";
	foreach ($list as $string)
		echo $string, " ; ";


	adm_info ("list of sessions");
	// ***************************
	$db->exec ("SELECT * FROM Sessions;");
	simple_dump ();

?>
Return current item: Article System