martes, 15 de agosto de 2017

EJERCICIO

EJERCICIO DE PRACTICA PARA EL PROYECTO.

<html>
<head>
<title>Practica</title>
</head>

<body>
<form method="post">

<label>Digite su nombre</label><input type="text" name="nombre" required></br></br></br>
<label>Telefono</label><input type="number" name="telefono" pattern="[0-9]{7}" required></br></br></br>

<label>Motivo</label><select name="seleccion" required>
<option></option>
<option value="a">Arreglos de nota</option>
<option value="b">Sugerencia</option>
<option value="c">Tema</option>

</select></br></br></br>

<label>Observaciones</label></br><textarea rows="9" cols="70" name="obs"></textarea></br></br></br>

<input type="submit">

</form>
</body>
<?php

if (isset($_POST['seleccion']))
{
           $seleccion = $_POST['seleccion'];
           $obser = $_POST['obs'];
                 

            if ($seleccion == "a")
               { echo substr("$obser", 0, 10);}

else if ($seleccion == "b"){

echo "<b>" . ucfirst($obser). "</b>" ;}

else if ($seleccion == "c")
               echo "<a href='$obser' target='_blank'>$obser</a>";
            else{}
                            }

        ?>
</html>

No hay comentarios.:

Publicar un comentario