30.10
This commit is contained in:
@@ -18,30 +18,32 @@
|
||||
</div>
|
||||
<div class="box">
|
||||
<form action="index.php" method="post">
|
||||
<label for="a">Wprowadź liczbę A:</label><br>
|
||||
<input type="number" name="a" id="a"><br>
|
||||
<label for="b">Wprowadź liczbę B:</label><br>
|
||||
<input type="number" name="b" id="b"><br><br>
|
||||
<fieldset>
|
||||
<label for="a">Wprowadź liczbę A:</label>
|
||||
<input type="number" name="a" id="a">
|
||||
<label for="b">Wprowadź liczbę B:</label>
|
||||
<input type="number" name="b" id="b">
|
||||
</fieldset>
|
||||
<button type="submit">Wyślij</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="box">
|
||||
<?php
|
||||
if (isset($_POST['a']) && isset($_POST['b'])) {
|
||||
$a = (int)htmlspecialchars($_POST['a']);
|
||||
$b = (int)htmlspecialchars($_POST['b']);
|
||||
if ($a < $b) {
|
||||
for ($i = $a; $i <= $b; $i++) {
|
||||
echo "$i ";
|
||||
}
|
||||
}
|
||||
if ($b < $a) {
|
||||
for ($i = $b; $i <= $a; $i++) {
|
||||
echo "$i ";
|
||||
}
|
||||
<?php
|
||||
if (isset($_POST['a']) && isset($_POST['b'])) {
|
||||
echo '<div class="box">';
|
||||
$a = (int)htmlspecialchars($_POST['a']);
|
||||
$b = (int)htmlspecialchars($_POST['b']);
|
||||
if ($a < $b) {
|
||||
for ($i = $a; $i <= $b; $i++) {
|
||||
echo "$i ";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
if ($b < $a) {
|
||||
for ($i = $b; $i <= $a; $i++) {
|
||||
echo "$i ";
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user