// database unavailable error check
$WebStatus = "Up";
$dsn = 'mysql:dbname=cgfp;host=mysql.qwknetllc.com';
$user = 'lennyg';
$password = 'C2nrk127-';
try {
$dbh = new PDO($dsn, $user, $password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
/*
$EMailTo = "WebMaster@cgfp.org";
$EMailSubject = "Database Access Error";
$EMailMsg = "Database is broken...";
$AutoEMail = "auto-msg@cgfp.org";
$EMailHeaders = "From: $AutoEMail\n";
$EMailHeaders .="Reply-To: $AutoEMail\n\n";
$ReturnPath = "auto-msg@cgfp.org";
$EMailSubject = stripslashes($EMailSubject);
$EMailMsg = stripslashes($EMailMsg);
mail("$EMailTo", "$EMailSubject", $EMailMsg, $EMailHeaders, "-f$ReturnPath");
*/
$WebStatus = "Down";
}
$DocRoot = $_SERVER['DOCUMENT_ROOT'];
$Forward = $_GET['Forward'];
$Mode = $_GET['Mode'];
if($WebStatus != "Down" || $Mode > 0) {
include ($DocRoot."/inc/config.php");
include ($DocRoot."/inc/access_log.php");
if ($Forward) { // For forwarded links leaving the site
include ($DocRoot."/inc/forward.php");
include ($DocRoot."/inc/common_footer.php");
} ELSE { // Regular site pages
include ($DocRoot."/inc/header1.php");
if ($Format == "Print") {
include ($DocRoot."/inc/header3.php"); // Print format without a background or colors
} else {
include ($DocRoot."/inc/header2018.php"); // Special 2018 50th Anniversary site page layout
// include ($DocRoot."/inc/header_center.php"); // normal site page layout
}
include ($DocRoot."/inc/common_body_center.php"); // calls the main page content
include ($DocRoot."/inc/common_footer_center.php"); // Common page footer
}
} else {
echo "Clairemont Girls Fastpitch is currently experiencing difficulty or being updated. Please try again shortly, or view our Facebook page at Facebook.
The webmaster has been notified of the error";
}
?>