<?php
    /*################### Start DB ##################*/
    try{
        $pdo = new PDO("mysql:host=localhost;dbname=".DB_NAME."", DB_USER, DB_PASS);
    }
    catch(PDOException $e){
        echo $e->getMessage();
		exit;
    }
    /*################### End DB ##################*/
?>
<?php
define ("URI", explode ("/",$_SERVER["REQUEST_URI"]));

if ( $_SERVER['HTTP_HOST'] == "localhost" )
{
	for( $s=1; $s <= count( URI ); $s++ )
	{
		$segment[] = @URI[$s];
	}
	
	define ("BASE_URL", (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . "/" . $segment[0]);
}
else
{
	for( $s=0; $s <= count( URI ); $s++ )
	{
		$segment[] = @URI[$s];
	}
	
	define ("BASE_URL", (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST']);
	define ("THEME_PATH", (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST']. "/themes/" .THEME. "");
}

define ("ACTUAL_LINK", (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);

?>
<?php
/*** Admin page ***/
define('MODULE', @$_GET['module']);
?>