Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/04/2016, 15:24
alejandro896
 
Fecha de Ingreso: abril-2016
Ubicación: venezuela
Mensajes: 5
Antigüedad: 8 años, 1 mes
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";

?>