public function __construct() { @session_start(); self::$db = Database::__getInstance(); $this->data = filter_input_array(INPUT_POST); if($this->data) $this->csrfCheck(); }
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Testovací zadání Vizus eshop"/> <meta name="keywords" content=",Vizus, eshop"/> <meta name="author" content="Josef Jakub Jestřáb"/> <meta name="copyright" content="(c) 2016 VIZUS.CZ s.r.o." <meta name="Robots" content="all"/> <link rel="stylesheet" href="/css/style.css"> </head> <body> <div id = header> <h1 class = "nor">Vizus E-shop</h1><br /> <?php @session_start(); //unset($_SESSION["cart_products"]); include('../model/Database.php'); $db = Database::__getInstance(); //$_SESSION["info"] zobrazuje vysledek operaci, paklize se nejake udaly if((isset($_SESSION["info"])) && (!empty($_SESSION["info"]))){ ?> <div id = "info"><p><?php echo $_SESSION["info"]; ?></p></div> <?php } if(isset($_SESSION["info"])){ $_SESSION["info"] = null;} //generuje csrf token pro formulare if (!isset($_SESSION["csrf_token"])) { $_SESSION["csrf_token"] = rand(1, 1e9); } //zjistuje GET hodnoty, ktere urcuji, jaky obsah zobrazit $detail_id = filter_input(INPUT_GET, 'detail_id');