Källkod

Välj en PHP-fil för att visa dess källkod.

incl/header.php

<?php
$title 
= $title ?? 'Webbserverprogrammering – Simon Andersson';
$pageId = $pageId ?? 'exercises';
$baseUrl = $baseUrl ?? '';
?>
<!doctype html>
<html lang="sv">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?= htmlspecialchars($title, ENT_QUOTES, 'UTF-8') ?></title>
    <link rel="stylesheet" href="<?= htmlspecialchars($baseUrl . 'style/stylesheet.css', ENT_QUOTES, 'UTF-8') ?>" title="General stylesheet">
    <?php if (isset($pageStyle)): ?>
        <style><?= $pageStyle ?></style>
    <?php endif; ?>
</head>
<body id="<?= htmlspecialchars($pageId, ENT_QUOTES, 'UTF-8') ?>">
    <header id="top" class="site-header">
        <span class="logga">Webbserverprogrammering 1</span>
        <nav class="navigering" aria-label="Huvudmeny">
            <a id="start-" href="<?= htmlspecialchars($baseUrl . 'index.php', ENT_QUOTES, 'UTF-8') ?>">Hem</a>
            <a id="exercises-" href="<?= htmlspecialchars($baseUrl . 'exercises.php', ENT_QUOTES, 'UTF-8') ?>">Övningar</a>
            <a id="viewsource-" href="<?= htmlspecialchars($baseUrl . 'viewsource.php', ENT_QUOTES, 'UTF-8') ?>">Källkod</a>
            <a href="<?= htmlspecialchars($baseUrl . '../index.html', ENT_QUOTES, 'UTF-8') ?>">Kurssidan</a>
        </nav>
    </header>
    <main class="page">
    <?php if (!empty($includeWelcome)): ?>
        <h1>Välkommen!</h1>
    <?php endif; ?>