Foros del Web » Programando para Internet » PHP »

pasar de html a php y luego otro php

Estas en el tema de pasar de html a php y luego otro php en el foro de PHP en Foros del Web. buenas tardes amigos estoy intentando hacer una web en la cual tengo un formulario html y envio los datos a un php el cual recibe ...
  #1 (permalink)  
Antiguo 06/04/2016, 15:24
 
Fecha de Ingreso: abril-2016
Ubicación: venezuela
Mensajes: 5
Antigüedad: 8 años
Puntos: 0
pasar de html a php y luego otro php

buenas tardes amigos estoy intentando hacer una web en la cual tengo un formulario html y envio los datos a un php el cual recibe los datos, rellena otros y hace envio a un tercer php, el inconveniente se presenta porque pierdo los datos del html, podrian ayudarme?

<!doctype html>
<html lang=''>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="script.js"></script>

</head>
<body>

<div>
<h5>SERIE</h5>
<form name="serie" id="serie" method="post" action="pagina2.php">
<table width="294" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20" height="22">
<label><input type="radio" name="radio2" id="radio2" value="OPCION1"></label>
</td>
<td width="274"><h6 style="margin:0;">OPCION1</h6></td>
</tr>
<tr>
<td height="22">
<label><input type="radio" name="radio2" id="radio2" value="OPCION2"></label>
</td>
<td><h6 style="margin:0;">OPCION2</h6></td>
</tr>
</table>
<br>
<CENTER><input type="image" src="images/sig.png" name="submit" value="Enviar"></CENTER>
</form>
</div>

</body>
<html>


PAGINA2
<!doctype html>
<html lang=''>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="script.js"></script>

<?php

session_start();
$_SESSION['radio2'] = $_POST['radio2'];
?>
</head>
<body>

<form name="serie" id="serie" method="post" action="pagina3.php">

<table width="294" border="0">
<tr>
<td width="54"><h6 style="margin:0;">Nombre:</h6></td>
<td width="224"><input name="nombre" type="text" id="nombre" style="background-color:#CCCCCC" size="25" maxlength="30" required/></td>
</tr>
<tr>
<td><h6 style="margin:0;">Apellido:</h6></td>
<td><input name="apellido" type="text" id="apellido" style="background-color:#CCCCCC" size="25" maxlength="30" required/></td>
</tr>
<tr>
<td><h6 style="margin:0;">Tlf:</h6></td>
<td><input name="tlf" type="text" id="tlf" style="background-color:#CCCCCC" size="25" maxlength="15" required/></td>
</tr>
<tr>
<td><h6 style="margin:0;">Email:</h6></td>
<td><input name="mail" type="text" id="mail" style="background-color:#CCCCCC" size="25" required/></td>
</tr>
</table><br>
<center>
<input type="image" src="images/sig.png" name="submit" value="Enviar">
</center>
</form>


</body>
<html>

PAGINA 3

<?php
session_start();
$_SESSION['radio2'] = $_POST['radio2'];
$opcion = $_POST['radio2'];
$opcion2 = $_POST['opcion'];
$opcion4 = $_SESSION['radio2'];
$nombre = $_POST['nombre'];
$apellido = $_POST['apellido'];
$tlf = $_POST['tlf'];
$mail = $_POST['mail'];
$header = 'From: ' . $mail . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";
$mensaje .= "SELECCIÓN DEL CHECKBOX: " . $_SESSION['radio2'] . " \r\n\n";
$mensaje .= "Este mensaje fue enviado por: \r\n\n";
$mensaje .= "Nombre: " . $nombre . " \r\n";
$mensaje .= "Apellido: " . $apellido . " \r\n";
$mensaje .= "Telefono: " . $tlf . " \r\n";
$mensaje .= "Su e-mail es: " . $mail . " \r\n";
$mensaje .= "Enviado el: " . date('d/m/Y', time());

$para = '[email protected],[email protected]';
$asunto = 'SOLICITUD';

mail($para, $asunto, utf8_decode($mensaje), $header);
echo "<script>document.location.href='index.html';</script>\n";

?>
  #2 (permalink)  
Antiguo 06/04/2016, 15:41
 
Fecha de Ingreso: noviembre-2003
Ubicación: Zaragoza, España
Mensajes: 1.257
Antigüedad: 20 años, 5 meses
Puntos: 154
Respuesta: pasar de html a php y luego otro php

Qué pereza leer código sin Highlight...!!
  #3 (permalink)  
Antiguo 06/04/2016, 17:56
Avatar de xfxstudios  
Fecha de Ingreso: junio-2015
Ubicación: Valencia - Venezuela
Mensajes: 2.448
Antigüedad: 8 años, 10 meses
Puntos: 263
Respuesta: pasar de html a php y luego otro php

de pana da pereza pero el asunto es que no entendi lo de pasar el html. Por otro lado, si cargas informacion en un formulario y luego debes rellenar otro, podrias recibir las variables el primero en el segundo y almacenarlas en algunos inputs ocultos por ejemplo y luego hacer el envio completo hacia el php que procesara la info.

Otra opcion seria realizar un solo formulario y si este es muy largo darle un efecto con jquery o js para que parezca que esta realizando una transicion entre un div y otro, de esa manera mantienes la totalidad del formulario pero mostrandolo en dos secciones
__________________
[email protected]
HITCEL

Etiquetas: formulario, html
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:52.