<?php
/*
 * This file is part of Web Pro Manager.
 * 
 * Web Pro Manager 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 3 of the License, or
 * (at your option) any later version.
 * 
 * Web Pro Manager 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.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Web Pro Manager.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * @author The Web Pro Miami, Inc. <info@thewebpro.com>
 * @copyright The Web Pro Miami, Inc. <info@thewebpro.com>, http://www.thewebpro.com/
 * @license http://www.gnu.org/licenses/gpl.html GNU GPL
 * @package WebProManager
*/

$Host = "[#nDBHost#]";
$DBName = "[#nDBName#]";
$User = "[#nDBUser#]";
$Password = "[#nDBPass#]";
$Link = mysql_connect($Host,$User,$Password) or die("We're sorry...the database is currently unavailable.  Please try back again soon.<BR><BR>Error: ".mysql_error());

// Internationalization
ini_set("default_charset","utf-8");
mysql_query("SET character_set_results=utf8", $Link);
@mb_language("uni"); 
@mb_internal_encoding("UTF-8");

// Check if database connection is available
$db_selected = mysql_select_db($DBName, $Link);
if (!$db_selected) { die ("Could not connect to database!<BR><BR>Error: " . mysql_error()); }

mysql_query("SET NAMES 'utf8'",$Link);

// Apply escape chars manually to all submitted data to prevent SQL injection
if (!get_magic_quotes_gpc()) {
	$_REQUEST = array_map('mysql_real_escape_string',$_REQUEST);
	$_GET = array_map('mysql_real_escape_string',$_GET);
	$_POST = array_map('mysql_real_escape_string',$_POST);
	$_COOKIE = array_map('mysql_real_escape_string',$_COOKIE); 
}
?>
