--- a/config.php +++ b/config.php @@ -1,109 +1,121 @@ setAttribute(PDO::ATTR_ERRMODE, - PDO::ERRMODE_EXCEPTION); - } - catch(PDOException $e) { + $db->setAttribute(PDO::ATTR_ERRMODE, + PDO::ERRMODE_EXCEPTION); +} catch (PDOException $e) { // Print PDOException message echo $e->getMessage(); - } +} +function local_url() +{ + return "http://" . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/"; +} -function includeHeader($title) { -?> - - - - - - - - - +function includeHeader($title) +{ + ?> + + + + + + + + + - Starter Template for Bootstrap + <?= $title ?> - - - + - + + + + + - - + + - - - + + + - + - - -
-
-
-
+
+
+
getMessage(); - } -?> +function includeFooter() +{ + global $db; + try { + /************************************** + * Close db connections * + **************************************/ -
- - -getMessage(); + } + ?> + + + + +