esercizio 1 matrice in Php per la 4 E Sia

<html>
  <head>
      <title>Matrice con 26 righe e 2 colonne</title>
    </head>
    <body>
        <table border="1" width="100%" height="10%" bgcolor="green">
            <tr>
                <td width="15%"><center><a href="../index.html"><img src="inverno.jpg" width="120" height="120"></a></center></td>
                <td width="70%"><center><font face="verdana" size="5">Gestione matrici</font></center></td>
                <td width="15%"><center><a href="../index.html">Home</a>/Mappa</center></td>
            </tr>
        </table>
        <table border="1" width="100%" height="20%" bgcolor="lightgreen">
            <tr valign="top">
                <td align="center">
                    <?php
                        echo "<form action='matrici1.php' method='POST'>
                  <font face='verdana' size='4'>Digitare una frase</font><p>
                  Frase: <input name='frase' size='30' maxlength='30'><p>         
                  <input type='submit' value='Invia' name='inviat'>
                  <input type='reset' value='Cancella'>
                                </form>";
                        // Verifica che l'utente abbia digitato il tasto invia
                        if (isset($_POST['inviat'])) {
                            // Inizializzazione delle variabili
                            $frase=strtoupper($_POST['frase']);
                            // Caricare la prima colonna della matrice
                            $j=0; $k=100;
                            for ($i=65;$i<=90;$i++) {
                                $matrice[$j][0]=chr($i);
                                $matrice[$j][1]=$k;
                                $j++; $k++;
                            }
/*for ($i=0;$i<=25;$i++) {
    echo $matrice[$i][0] . "<br>";
}*/                       
                        }
                    ?>
                </td>
            </tr>
        </table>
    </body>
</html>

Commenti

Post popolari in questo blog

Simulazioni di reti (con Cisco Packet Tracer)

Esercizi sulla rappresentazione della virgola mobile IEEE 754 (Floating Point)