Add m1
This commit is contained in:
parent
671778a8eb
commit
b703505447
16
www/public/M1/01/handle.php
Normal file
16
www/public/M1/01/handle.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Valutan i kronor</h1>
|
||||||
|
<?php
|
||||||
|
$dollar = $_POST['currency'];
|
||||||
|
$sek = $dollar * 11;
|
||||||
|
echo "<p>$dollar $ = $sek kr</p>";
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
18
www/public/M1/01/index.php
Normal file
18
www/public/M1/01/index.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>M1-test</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form action="./handle.php" method="post">
|
||||||
|
<fieldset>
|
||||||
|
<legend>Currency</legend>
|
||||||
|
<label>Amount in $</label><br>
|
||||||
|
<input type="text" name="currency">
|
||||||
|
<input type="submit" value="Convert to SEK">
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
17
www/public/M1/02/handle.php
Normal file
17
www/public/M1/02/handle.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Years to pensoin</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Years to pensoin</h1>
|
||||||
|
<?php
|
||||||
|
$name = $_POST['name'];
|
||||||
|
$age = $_POST['age'];
|
||||||
|
$to_pension = 65 - $age;
|
||||||
|
echo "<p>$name has $to_pension years to pension";
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
22
www/public/M1/02/index.php
Normal file
22
www/public/M1/02/index.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>M1-test</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form action="./handle.php" method="post">
|
||||||
|
<fieldset>
|
||||||
|
<legend>Person</legend>
|
||||||
|
<label>Name</label>
|
||||||
|
<input type="text" name="name">
|
||||||
|
<br>
|
||||||
|
<label>Age</label>
|
||||||
|
<input type="text" name="age">
|
||||||
|
<br>
|
||||||
|
<input type="submit" value="Submit">
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
16
www/public/M1/03/calculate.php
Normal file
16
www/public/M1/03/calculate.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Calculation Result</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
$n1 = $_POST['n1'];
|
||||||
|
$n2 = $_POST['n2'];
|
||||||
|
$sum = $n1 + $n2;
|
||||||
|
echo "<p>$n1 + $n2 = $sum</p>"
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
17
www/public/M1/03/index.php
Normal file
17
www/public/M1/03/index.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head lang="sv"></head>
|
||||||
|
<body>
|
||||||
|
<h1>Matematik-test</h1>
|
||||||
|
|
||||||
|
<form action="calculate.php" method="post">
|
||||||
|
<fieldset>
|
||||||
|
<legend>Calculator</legend>
|
||||||
|
<input type="number" name="n1"> +
|
||||||
|
<input type="number" name="n2">
|
||||||
|
<br>
|
||||||
|
<input type="submit" value="Calculate">
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</body>
|
15
www/public/M1/04/handle.php
Normal file
15
www/public/M1/04/handle.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Result</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
$name = $_GET['name'];
|
||||||
|
$age = $_GET['age'];
|
||||||
|
echo "<p>Name - $name; Age - $age</p>"
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
19
www/public/M1/04/index.php
Normal file
19
www/public/M1/04/index.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head lang="sv"></head>
|
||||||
|
<body>
|
||||||
|
<h1>Send data via url</h1>
|
||||||
|
|
||||||
|
<form action="handle.php" method="get">
|
||||||
|
<fieldset>
|
||||||
|
<legend>Person</legend>
|
||||||
|
<label>Name</label>
|
||||||
|
<input type="text" name="name">
|
||||||
|
<label>Age</label>
|
||||||
|
<input type="number" name="age">
|
||||||
|
<br>
|
||||||
|
<input type="submit" value="Submit">
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</body>
|
36
www/public/M1/05/index.php
Normal file
36
www/public/M1/05/index.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head lang="sv"></head>
|
||||||
|
<body>
|
||||||
|
<h1>Send data via url</h1>
|
||||||
|
|
||||||
|
<form action="result.php" method="post">
|
||||||
|
<fieldset>
|
||||||
|
<legend>Quizz</legend>
|
||||||
|
<label>What is the first letter of Alphabet?</label> <br>
|
||||||
|
<input type="radio" name="q1" value="A">A <br>
|
||||||
|
<input type="radio" name="q1" value="B">B <br>
|
||||||
|
<input type="radio" name="q1" value="C">C <br>
|
||||||
|
<input type="radio" name="q1" value="D">D <br> <br>
|
||||||
|
|
||||||
|
<label>What is the second letter of Alphabet?</label> <br>
|
||||||
|
<input type="radio" name="q2" value="A">A <br>
|
||||||
|
<input type="radio" name="q2" value="B">B <br>
|
||||||
|
<input type="radio" name="q2" value="C">C <br>
|
||||||
|
<input type="radio" name="q2" value="D">D <br> <br>
|
||||||
|
|
||||||
|
<label>What is the third letter of Alphabet?</label> <br>
|
||||||
|
<input type="radio" name="q3" value="A">A <br>
|
||||||
|
<input type="radio" name="q3" value="B">B <br>
|
||||||
|
<input type="radio" name="q3" value="C">C <br>
|
||||||
|
<input type="radio" name="q3" value="D">D <br> <br>
|
||||||
|
|
||||||
|
<label>What is the fourth letter of Alphabet?</label> <br>
|
||||||
|
<input type="radio" name="q4" value="A">A <br>
|
||||||
|
<input type="radio" name="q4" value="B">B <br>
|
||||||
|
<input type="radio" name="q4" value="C">C <br>
|
||||||
|
<input type="radio" name="q4" value="D">D <br> <br>
|
||||||
|
|
||||||
|
<input type="submit" value="Submit">
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
24
www/public/M1/05/result.php
Normal file
24
www/public/M1/05/result.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Result</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
$points = 0;
|
||||||
|
$q1 = $_POST['q1'];
|
||||||
|
$q2 = $_POST['q2'];
|
||||||
|
$q3 = $_POST['q3'];
|
||||||
|
$q4 = $_POST['q4'];
|
||||||
|
|
||||||
|
if($q1 == "A") $points++;
|
||||||
|
if($q2 == "B") $points++;
|
||||||
|
if($q3 == "C") $points++;
|
||||||
|
if($q4 == "D") $points++;
|
||||||
|
|
||||||
|
echo "<p>Questions got right = $points</p>"
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
48
www/public/M1/06/index.php
Normal file
48
www/public/M1/06/index.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head lang="sv"></head>
|
||||||
|
<body>
|
||||||
|
<h1>Send data via url</h1>
|
||||||
|
|
||||||
|
<form action="result.php" method="post">
|
||||||
|
<fieldset>
|
||||||
|
<legend>Quizz</legend>
|
||||||
|
<label>What is the first letter of Alphabet?</label> <br>
|
||||||
|
<input type="radio" name="q1" value="A">A <br>
|
||||||
|
<input type="radio" name="q1" value="B">B <br>
|
||||||
|
<input type="radio" name="q1" value="C">C <br>
|
||||||
|
<input type="radio" name="q1" value="D">D <br> <br>
|
||||||
|
|
||||||
|
<label>What is the second letter of Alphabet?</label> <br>
|
||||||
|
<input type="radio" name="q2" value="A">A <br>
|
||||||
|
<input type="radio" name="q2" value="B">B <br>
|
||||||
|
<input type="radio" name="q2" value="C">C <br>
|
||||||
|
<input type="radio" name="q2" value="D">D <br> <br>
|
||||||
|
|
||||||
|
<label>What is the third letter of Alphabet?</label> <br>
|
||||||
|
<input type="radio" name="q3" value="A">A <br>
|
||||||
|
<input type="radio" name="q3" value="B">B <br>
|
||||||
|
<input type="radio" name="q3" value="C">C <br>
|
||||||
|
<input type="radio" name="q3" value="D">D <br> <br>
|
||||||
|
|
||||||
|
<label>What is the fourth letter of Alphabet?</label> <br>
|
||||||
|
<input type="radio" name="q4" value="A">A <br>
|
||||||
|
<input type="radio" name="q4" value="B">B <br>
|
||||||
|
<input type="radio" name="q4" value="C">C <br>
|
||||||
|
<input type="radio" name="q4" value="D">D <br> <br>
|
||||||
|
|
||||||
|
<label>What is the fifth letter of Alphabet?</label> <br>
|
||||||
|
<input type="radio" name="q5" value="E">E <br>
|
||||||
|
<input type="radio" name="q5" value="F">F <br>
|
||||||
|
<input type="radio" name="q5" value="G">G <br>
|
||||||
|
<input type="radio" name="q5" value="H">H <br> <br>
|
||||||
|
|
||||||
|
<label>What is the sixth letter of Alphabet?</label> <br>
|
||||||
|
<input type="radio" name="q6" value="E">E <br>
|
||||||
|
<input type="radio" name="q6" value="F">F <br>
|
||||||
|
<input type="radio" name="q6" value="G">G <br>
|
||||||
|
<input type="radio" name="q6" value="H">H <br> <br>
|
||||||
|
|
||||||
|
<input type="submit" value="Submit">
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
35
www/public/M1/06/result.php
Normal file
35
www/public/M1/06/result.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Result</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php
|
||||||
|
$points = 0;
|
||||||
|
$q1 = $_POST['q1'];
|
||||||
|
$q2 = $_POST['q2'];
|
||||||
|
$q3 = $_POST['q3'];
|
||||||
|
$q4 = $_POST['q4'];
|
||||||
|
$q5 = $_POST['q5'];
|
||||||
|
$q6 = $_POST['q6'];
|
||||||
|
|
||||||
|
$result;
|
||||||
|
|
||||||
|
if($q1 == "A") $points++;
|
||||||
|
if($q2 == "B") $points++;
|
||||||
|
if($q3 == "C") $points++;
|
||||||
|
if($q4 == "D") $points++;
|
||||||
|
if($q5 == "E") $points++;
|
||||||
|
if($q6 == "F") $points++;
|
||||||
|
|
||||||
|
if($points >= 5) $result = "Bra, du behärskar det mesta";
|
||||||
|
else if($points >= 3) $result = "Godkänd";
|
||||||
|
else $result = "Läs på mer och försök igen";
|
||||||
|
|
||||||
|
|
||||||
|
echo "<p>$result, poäng - $points</p>"
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,11 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>M1-test</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<?php echo "Hello world "?>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in New Issue
Block a user