Esecizi in php su moduli

This commit is contained in:
2014-10-26 12:40:01 +01:00
parent c318b09580
commit 3924e6bf32
7 changed files with 410 additions and 2 deletions

View File

@@ -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";
}