Show sourcecode
The following files exists in this folder. Click to view.
ovn_form1-1.php
ovn_form1-2.php
ovn_form2-1.php
ovn_form2-2.php
ovn_form3-1.php
ovn_form3-2.php
ovn_form4-1.php
ovn_form4-2.php
ovn_form5-1.php
ovn_form5-2.php
ovn_form6-1.php
ovn_form6-2.php
ovn_form7-1.php
ovn_form7-2.php
ovn_form8.php
ovn_form7-2.php
30 lines UTF-8 Windows (CRLF)
<?php
// Title: Formulär 7
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 7</title>
</head>
<body>
<?php
$nr1 = $_POST['nr1'];
$nr2 = $_POST['nr2'];
$nr3 = $_POST['nr3'];
function average($nr1, $nr2, $nr3) {
$average = ($nr1 + $nr2 + $nr3) / 3;
return $average;
}
$string = "Talen: $nr1, $nr2, $nr3, har ett medelvärde på: " . average($nr1, $nr2, $nr3);
echo htmlspecialchars($string);
?>
</body>
</html>