<?php /** * Project in web development with PHP * @author Joakim Holmewi * With some references from Daniel Toll */ require_once "Settings.php"; require_once "exceptions/ImageException.php"; require_once "exceptions/ProductException.php"; require_once "exceptions/DatabaseException.php"; require_once "exceptions/CategoryException.php"; require_once "view/HTMLView.php"; require_once "controller/MasterController.php"; if (Settings::DISPLAY_ERRORS) { error_reporting(-1); ini_set('display_errors', 'ON'); } session_start(); $mc = new \controller\MasterController(); $mc->doMasterControl(); $container = $mc->generateContainer(); $aside = $mc->generateAside(); $html = new \view\HTMLView(); $html->getHTML($container->getResponse(), $aside->getResponse());
<?php require_once 'controller/ScrapeController.php'; require_once 'view/HTMLView.php'; require_once 'view/ScrapeView.php'; require_once 'model/Scraper.php'; require_once 'model/MovieSuggestion.php'; $urlPostLocation = "url"; $submitPostLocation = "submit"; if (isset($_POST[$submitPostLocation])) { setcookie(\controller\ScrapeController::$baseURLlocation, $_POST[$urlPostLocation], time() + 60 * 60 * 24 * 30); $_COOKIE[\controller\ScrapeController::$baseURLlocation] = $_POST[$urlPostLocation]; header("Location: scraper.php"); } $view = new \view\HTMLView(); echo $view->getHTML("<form method='post'>\n <label>Ange URL: </label>\n <input type='text' class='form-control' style='max-width:30%;' name='" . $urlPostLocation . "'>\n <br>\n <input type='submit' class='btn btn-primary' name='" . $submitPostLocation . "'>\n </form>");
<?php require_once "model/Logger.php"; require_once "view/HTMLView.php"; require_once "controller/LogController.php"; session_start(); $nav = new \view\NavigationView(); $m = new \model\Logger(); $v = new \view\HTMLView($nav); $c = new \controller\LogController($m, $v, $nav); $c->doControl(); $container = $c->getView(); echo $v->getHTML($container);