website/v4/index.php

89 lines
2.4 KiB
PHP

<?php
session_start();
$prod = false;
// Display Errors
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
// Display var_dump
#var_dump($_SESSION);
// Date Time Zone
date_default_timezone_set('Europe/Prague');
// site info
$keywords = "";
$description = "";
$locale = "cs_CZ";
$title = "";
$site_name = "";
$author = "Fofrweb | https://fofrweb.com";
$email = "webmaster(@)fofrweb.com";
$canonical = "https://";
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1.0" />
<meta id="contentLanguage" http-equiv="Content-Language" content="<?= $locale ?>" />
<meta name="keywords" content="<?= $keywords ?>" />
<meta name="description" content="<?= $description ?>" />
<meta property="og:locale" content="<?= $locale ?>" />
<meta property="og:type" content="website" />
<meta property="og:title" content="<?= $title ?>" />
<meta property="og:description" content="<?= $description ?>" />
<meta property="og:site_name" content="<?= $site_name ?>" />
<meta name="author" content="<?= $author ?>" />
<meta name="email" content="<?= $email ?>" />
<meta name="copyright" content="<?= $copyright ?>" />
<meta name="expires" content="never" />
<?php
if($prod) { ?>
<meta name="robots" content="index,follow" />
<meta name="Seznambot" content="index,follow" />
<meta name="Googlebot" content="index,follow" />
<?php } else { ?>
<meta name="robots" content="noindex, nofollow" />
<meta name="Seznambot" content="noindex, nofollow" />
<meta name="Googlebot" content="noindex, nofollow" />
<?php } ?>
<title><?= $title ?></title>
<link rel="canonical" href="<?= $canonical ?>" />
</head>
<body>
<?php
if(isset($_GET['page'])) {
$file = $_GET['page'];
$file2 = dirname($_SERVER['SCRIPT_FILENAME']) . "/pages/$file/$file.php";
echo $file2;
if(file_exists($file2)) {
if(substr_count($file, "../") > 0) {
echo("<h3>Upozornění</h3> Nelze nahrát soubor v nadřazeném adresáři.");
}
elseif($file == "index" || $file == "/index") {
echo("<h3>Upozornění</h3> Index nemůže načíst sám sebe.");
} else {
require_once($file2);
}
}
else {
require_once("./pages/error_404.php");
}
}
else {
require_once("./pages/home/home.php");
}
?>
</body>
</html>