<?php
require("includes/settings.php");

if (file_exists("config.php")) {
	require("config.php");
} else {
	require("config.example.php");
	print("<html><head>");
	print("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">");
	print("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$charset."\">");	print("<title>".$longtitle."</title>");
	print("<link href=\"css/main.css\" rel=\"stylesheet\" type=\"text/css\"></head><body>");
	print("<center><br><img src=\"images/warning.png\"><br><br>");
	print("<h1>Config.php file not found! Did you rename config.example.php to config.php?</h1>");
	print("</center></body></html>");
	exit;
}

if ($dbhost == "") {
	print("<html><head>");
	print("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">");
	print("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$charset."\">");	print("<title>".$longtitle."</title>");
	print("<link href=\"css/main.css\" rel=\"stylesheet\" type=\"text/css\"></head><body>");
	print("<center><br><img src=\"images/warning.png\"><br><br>");
	print("<h1>Please setup your config.php before using ".$shorttitle."!</h1>");
	print("</center></body></html>");
	exit;
}

$conn = @mysql_connect($dbhost,$dbuser,$dbpass) or sqlerror();
mysql_select_db($dbname, $conn) or sqlerror();
mysql_close($conn);
?>