miércoles, 15 de marzo de 2017

Formulario PHP

PHP

Formulario de toma de datos en PHP:


Código:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title> DATOS PERSONALES </title>
</head>
<body>
  <form method="post" action="datos4to.php">
    <h6>Datos personales</h6>
    <b><center>Ingrese su nombre:</center></b>
    <input type="text" name="nombre">
    <br><br>
    <b><center>Ingrese su dirección:</center></b>
    <input type="text" name="direccion">
    <br><br>
    <b><center>Ingrese su telefóno:</center></b>
    <input type="text" name="telefono">
    <br><br>
    <b><center>Ingrese su sexo:</center></b>
    <input type="text" name="sexo">
    <br><br>
    <input type="submit" value="Enviar Datos">
  </form>
</body>
</html>


Datos ingresados impresos:


Código:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title> IMPRESIÓN DE ENVIO DE DATOS</title>
</head>
<body bgcolor="#8BC34A">
  <h1><center>DATOS PERSONALES</center></h1>
<?php
echo "Nombre:"."\t".$_REQUEST['nombre'];
echo "<br>Dirección:"."\t".$_REQUEST['direccion'];
echo "<br>Telefóno:"."\t".$_REQUEST['telefono'];
echo "<br>Sexo:"."\t".$_REQUEST['sexo'];
echo "<br>Hola"."\t".$_REQUEST['nombre']."\t"."vives en"."\t".$_REQUEST['direccion']."\t"."tu telefóno es"."\t".$_REQUEST['telefono']."\t"."y eres de sexo"."\t".$_REQUEST['sexo'];
  ?>
</body>
</html>


No hay comentarios:

Publicar un comentario