Example #1
0
function conjugar($verbo)
{
    global $conjugaciones;
    $conjugacion;
    $raiz = substr($verbo, 0, -2);
    $respuesta = "";
    $conjugacion = conjugaciones($verbo);
    $respuesta = '<select name="verboConjugaciones">';
    for ($i = 0; $i < 6; $i++) {
        $respuesta .= "<option value=\"{$i}\">{$raiz}{$conjugaciones[$conjugacion][$i]}</option>";
    }
    $respuesta .= '</select>';
    return $respuesta;
}
Example #2
0
<?php

include '../ej01/util.php';
session_start();
$verbosIntroducidos = isset($_SESSION['verbos']) ? $_SESSION['verbos'] : null;
$verbos = explode("#", $verbosIntroducidos);
echo "<h2>Lista de verbos</h2>";
echo "<table border=\"1\"><tr><th>Infinitivo</th><th>Conjugacion</th><th>Presente de indicativo</th></tr>";
for ($i = 0; $i < sizeof($verbos) - 1; $i++) {
    echo "<tr><td>{$verbos[$i]}</td><td>" . conjugaciones($verbos[$i]) . "</td><td>" . conjugar($verbos[$i]) . "</td></tr>";
}
echo "</table>";
echo <<<FORM
<form action="formulario.php">
\t<input type="submit" name="destruirSesion" value="Volver a introducir verbos" />
</form>
FORM
;
<?php

include '../ej01/util.php';
$verbo = isset($_REQUEST['verbo']) ? $_REQUEST['verbo'] : null;
echo conjugaciones($verbo);