Webbserv1: Källkod
Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbsrvprg/exercises/

dbtestforfattare.php
formular1.php
formular2.php
formular3.php
formular4.php
funktioner1-5.php
hej3.php
hej4.php
hej_svejs.php
index.php
ovngrunder1-4.php
sida1.php
sida2.php
sida3.php
sidslut.php
sidstart.php
uppgiftinklfiler.php
valkommen1.php
valkommen2.php

hej4.php

27 lines UTF-8 Windows (CRLF)
<?php
error_reporting
(-1);
ini_set('display_errors', 1);
ini_set('output_buffering', 0);

$fornamn   = htmlspecialchars($_POST["fornamn"]);
$efternamn = htmlspecialchars($_POST["efternamn"]);
$klass     = htmlspecialchars($_POST["klass"]);
$mat       = htmlspecialchars($_POST["mat"]);

if (isset(
$_POST["kurs"])) {
    
$kurs = htmlspecialchars($_POST["kurs"]);
} else {
    
$kurs = "ingen kurs vald";
}
?>
<!DOCTYPE html>
<html lang="sv">
<head>
    <meta charset="UTF-8">
    <title>Hej</title>
</head>
<body>
    <p>Hej <?php echo $fornamn . " " . $efternamn; ?> i <?php echo $klass; ?>! Du gillar <?php echo $mat; ?>!</p>
    <p>Din favoritkurs är <?php echo $kurs; ?>.</p>
</body>
</html>


Document