Buscar este blog

martes, 7 de agosto de 2018

Enviar datos a PHP

Es muy explícito:

Programa 1
<!DOCTYPE html>
<html> 
<head>
<meta charset="UTF-8">
<title>Pasar datos a otro php</title>
</head>
<body>
<div class="wrapper">
<p>Formulario de datos</p><br>
<div class="push">Subtitulos de ejemplo</div>
<div><form name="form1" id="form1" method="post" action="frm_smpl4b.php" />
<label for="label1" id="label1">Ingrese su nombre</label>
<input type="text" placeholder="Escribe tu nombre" maxlength="10" name="nombre" id="nombre" required />
<input type="password" name="password" id="password" required />
<input type="email" name="email" id="email"required/>
<input type="submit" name="button1" id="button1" value="Enviar" /> 
</form></div>
</div><br><br><br>
<div class="push" id="mydiv1">Resultados</div><br><br><br>
    <div class="footer">
<p>Derechos de autor reservados, Copyright jsantaella70 (c)2018</p>
</div>
</body>
</html>


Programa 2
<?php
echo 'He recibido los valores: ';
echo '<label>Nombre </label> ' . $_POST["nombre"] . '<br>';
echo '<label>Correo </label> ' . $_POST["email"] . '<br>';
echo '<label>Clave </label>' . $_POST["password"] . '<br>';
echo '<br>'.'Estoy empleando el atributo name de los campos del formulario recibido';
echo '<br>'.'Por supuesto, no he impreso todos los objetos';
echo '<br>'.'Por cierto, no debería imprimir el valor de un clave';
?>

No hay comentarios.:

Publicar un comentario