working on v4
This commit is contained in:
52
v4/index.php
52
v4/index.php
@ -2,6 +2,8 @@
|
||||
session_start();
|
||||
$prod = false;
|
||||
|
||||
require_once("./libraries/router.php");
|
||||
|
||||
// Display Errors
|
||||
ini_set('display_startup_errors', 1);
|
||||
ini_set('display_errors', 1);
|
||||
@ -44,8 +46,8 @@ $canonical = "https://www.filiprojek.cz/";
|
||||
<meta name="copyright" content="<?= $copyright ?>" />
|
||||
<meta name="expires" content="never" />
|
||||
|
||||
<?php
|
||||
if($prod) { ?>
|
||||
<?php
|
||||
if($prod) { ?>
|
||||
<meta name="robots" content="index,follow" />
|
||||
<meta name="Seznambot" content="index,follow" />
|
||||
<meta name="Googlebot" content="index,follow" />
|
||||
@ -60,33 +62,25 @@ $canonical = "https://www.filiprojek.cz/";
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
require_once("./components/header.php");
|
||||
|
||||
if(isset($_GET['page'])) {
|
||||
$file = $_GET['page'];
|
||||
$file2 = dirname($_SERVER['SCRIPT_FILENAME']) . "/pages/$file/$file.php";
|
||||
echo $file;
|
||||
|
||||
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");
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
|
||||
require_once("./components/header.php");
|
||||
?>
|
||||
<section class="content">
|
||||
<?php
|
||||
$R = new Router();
|
||||
$R->route('/', 'home');
|
||||
$R->route('/home', 'home');
|
||||
$R->route('/domu', 'home');
|
||||
|
||||
$R = null;
|
||||
?>
|
||||
</section>
|
||||
<footer>
|
||||
<?php
|
||||
require_once("./components/footer.php");
|
||||
?>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Reference in New Issue
Block a user