mirror of
https://github.com/FlyInTheBox/31TSAI.git
synced 2024-11-09 20:44:11 +01:00
l
This commit is contained in:
parent
d255e3163d
commit
288c09d171
1 changed files with 37 additions and 0 deletions
37
Zadanie 01.03.2023/index.php
Normal file
37
Zadanie 01.03.2023/index.php
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport"
|
||||||
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form action="index.php" method="post">
|
||||||
|
<fieldset>
|
||||||
|
<legend>Liczby</legend>
|
||||||
|
<?PHP
|
||||||
|
$arr = range(0, 100, 10);
|
||||||
|
foreach ($arr as $value) {
|
||||||
|
echo '<label for="check"><input type="checkbox" name="check[]" value="' . $value . '" id="box' . $value . '">' . $value . '</label>';
|
||||||
|
}
|
||||||
|
echo '<br><button type="submit">Wyślij</button>';
|
||||||
|
?>
|
||||||
|
<br><br>
|
||||||
|
<?PHP
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
if (empty($_POST['check'])) {
|
||||||
|
echo 'Nie wybrano żadnych liczb.';
|
||||||
|
} else {
|
||||||
|
echo 'Wybrano liczby: ';
|
||||||
|
foreach ($_POST['check'] as $value) {
|
||||||
|
echo $value . ', ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue