36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<!doctype html>
|
|
<html lang="pl">
|
|
<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>Z71 - Ile liczb</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Zadanie Z71</h1>
|
|
<h2>Autor: Jakub Grzegorczyk</h2>
|
|
</header>
|
|
<div class="box">
|
|
Napisz program, który dla podanej liczby całkowitej większej od zera odpowie ile ma ona cyfr.
|
|
</div>
|
|
<div class="box">
|
|
<form action="index.php" method="post">
|
|
<label for="a">Podaj liczbę: </label><br>
|
|
<input type="number" name="a" id="a"><br><br>
|
|
<button type="submit">Wyślij</button>
|
|
</form>
|
|
</div>
|
|
<div class="box">
|
|
<?php
|
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|
$a = (int)htmlspecialchars($_POST['a']);
|
|
$liczbaCyfr = strlen($a);
|
|
echo "Liczba cyfr: $liczbaCyfr";
|
|
}
|
|
?>
|
|
</div>
|
|
</body>
|
|
</html>
|