<?php /*error_reporting(E_ALL)*/;

$develop = getenv('DEVELOP');

if(isset($_SERVER['HTTP_REFERER'])) {
    $referer = $_SERVER['HTTP_REFERER'];
}
else
{
    $referer = "";
}

if ($develop == 'true') {
    $host = 'db';
    $user = 'root';
    $pass = 'SFluorit';
    $dbase = 'sternwarte';
} else if($develop == 'ide') {
    $host = '127.0.0.1:3306';
    $user = 'root';
    $pass = 'SFluorit';
    $dbase = 'sternwarte';
} else if (substr($referer,0,strlen('http://test.sternwarte-welzheim.de')) == 'http://test.sternwarte-welzheim.de') {
    $host = 'localhost';
    $user = 'db310927_5';
    $pass = '1kthcJvUj&qf';
    $dbase = 'db310927_5';
} else {
    $host = 'localhost';
    $user = 'db310927';
    $pass = 'vetivene-albarco-earner';
    $dbase = 'db310927';
}

$db = mysqli_connect($host, $user, $pass, $dbase) or die("Couldn't connect to the database_server $host - Develop = $develop");
mysqli_select_db($db,$dbase) or die("Couldn't select the database");

mysqli_query($db,"SET NAMES 'utf8'");
mysqli_query($db,"SET CHARACTER SET 'utf8'");

date_default_timezone_set('Europe/Berlin');

// Weitere Konstanten:
$maxBesucher = 25;
$defaultabsender = 'anmeldung@sternwarte-welzheim.de';
$maxProPerson = 10;

?>
