Show sourcecode
The following files exists in this folder. Click to view.
webbsrvprg/exercises/formular/
index.php
ovn_fm1.php
ovn_fm2.php
ovn_fm3.php
ovn_fm4+5.php
tillagg3.php
tillagg4.php
ovn_fm2.php
32 lines UTF-8 Windows (CRLF)
<?php
error_reporting(-1); // Report all type of errors
ini_set('display_errors', 1); // Display all errors
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
?>
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Formulär</title>
</head>
<body>
<?php
if (isset($_GET["namn"])) {
$namn = htmlspecialchars($_GET["namn"]);
echo ("Hjärtligt välkommen $namn!");
}
?>
<form method="GET">
<input type="text" name="namn" id="namn_id" placeholder="Skriv namn här" required>
<label for="namn_id">Namn</label><br>
<button type="submit">Skicka in</button>
</form>
</body>
</html>