Esecizi in php su moduli
This commit is contained in:
30
php_3.php
30
php_3.php
@@ -1,7 +1,8 @@
|
||||
|
||||
<?php
|
||||
|
||||
include ('header.html');
|
||||
require_once ('functions.php');
|
||||
include('header.html');
|
||||
|
||||
///////////////////////////
|
||||
echo<<<_css
|
||||
@@ -18,12 +19,37 @@ echo "\n";
|
||||
|
||||
if ($_GET == null){
|
||||
|
||||
print <<<_HTML
|
||||
<form method="get" action="php_3.php">
|
||||
First name: <input type="number" name="numero" autofocus required placeholder="Insert the number here" min="1" max="15" ><br>
|
||||
<input type="submit" value="Send">
|
||||
</form>
|
||||
|
||||
|
||||
_HTML;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
echo "fattoriale " . fattoriale($_GET['numero']) . "\n";
|
||||
echo "<br>";
|
||||
|
||||
echo "primi ";
|
||||
for ($i = 1;$i < $_GET['numero'] ; $i++)
|
||||
{
|
||||
if (isPrime($i))
|
||||
echo "$i ";
|
||||
|
||||
}
|
||||
echo "<br>";
|
||||
|
||||
echo "tabellina ";
|
||||
for ($i = 1;$i <= 10 ; $i++)
|
||||
{
|
||||
echo $i * $_GET['numero'] . " ";
|
||||
|
||||
}
|
||||
|
||||
echo "cioa";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user