Location: PHPKode > projects > Network Managment / Inventory System > clearsite/include/config.php
<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2006-2008 Xinn.org                                        |
 |                                                                         |
 | This program is free software; you can redistribute it and/or           |
 | modify it under the terms of the GNU General Public License             |
 | as published by the Free Software Foundation; either version 2          |
 | of the License, or (at your option) any later version.                  |
 |                                                                         |
 | This program is distributed in the hope that it will be useful,         |
 | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
 | GNU General Public License for more details.                            |
 +-------------------------------------------------------------------------+
 | ClearSite/ALOE, A Long Overdue Enterprise network managment solution!   |
 +-------------------------------------------------------------------------+
 | This code is designed, written, and maintained by the Xinn.org. See     |
 | about.php and/or the AUTHORS file for specific developer information.   |
 +-------------------------------------------------------------------------+
 | http://aloeusers.net                                                    |
 | http://clearsite.sourceforge.net                                        |
 | http://aloenms.net                                                      |
 | http://clear-site.net                                                   |
 | http://clear-site.info                                                  |
 | http://xinn.org/ClearSite.html                                          |
 +-------------------------------------------------------------------------+
*/

$cs_base_path = substr(__FILE__, 0, -19);

if (is_file("$cs_base_path/include/db_config.php")) {
  include_once("$cs_base_path/include/db_config.php");
} else {
  $not_installed = "not";
  return;
};

$cur_date = date("Y-m-d");

mysql_connect("$DBhost:$DBport",$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");

$config_query = "SELECT * FROM config";
$config_result = mysql_query($config_query);
while ($config_row = mysql_fetch_assoc($config_result)) {
  ${$config_row['name']} = $config_row['value'];
};

mysql_close();

?>
Return current item: Network Managment / Inventory System