Ver Mensaje Individual
  #24 (permalink)  
Antiguo 05/05/2010, 08:45
aisikauss
 
Fecha de Ingreso: junio-2009
Mensajes: 24
Antigüedad: 14 años, 10 meses
Puntos: 0
Respuesta: Pase de variables entre URL's des de un formulari en PHP

Cita:
<?
session_start();
?>
<html>
<head>
function Valida( formulario ) {
aux = true;
msg = "";
if (formulario.nombre.value == '') {
msg = "Nombre y Apellidos\n";
aux = false;
}
if (formulario.empresa.value == '') {
msg += "Empresa\n";
aux = false;
}
if (formulario.direccion.value == '') {
msg += "Dirección\n";
aux = false;
}
if (formulario.codigo_postal.value == '') {
msg += "Código postal\n";
aux = false;
}
if (formulario.localidad.value == '') {
msg += "Localidad\n";
aux = false;
}
if (formulario.pais.value == '') {
msg += "País\n";
aux = false;
}
if (formulario.telefono.value == '') {
msg += "Teléfono\n";
aux = false;
}
if (formulario.mail.value == '') {
msg += "Mail\n";
aux = false;
}
aux2 = false;
for (i=0; i<formulario.actividad.length; i++) {
if (formulario.actividad.options[i].selected == true) {
aux2 = true;
i=formulario.actividad.length;
}
}
if (aux2 == false) {
msg += "Actividad\n";
aux == false;
}
if ((formulario.Contabilidad.checked == '') && (formulario.Facturacion.checked == '') && (formulario.Fabricacion.checked == '') && (formulario.Elaboracion.checked == '') && (formulario.CerdasP.checked == '') && (formulario.VacunoL.checked == '') && (formulario.OvinoL.checked == '') && (formulario.CaprinoL.checked == '') && (formulario.Cebo.checked == '') && (formulario.VacunoC.checked == '') && (formulario.OvinoC.checked == '') && (formulario.CerdasI.checked == '') && (formulario.Cultivos.checked == '') && (formulario.PDA.checked == '')) {
msg += "Recibir información\n";
aux = false;
}
if (aux == false) alert("Falta completar los siguientes campos:\n\n" + msg);
return aux;
}


</head>

<body>
<table>
<tr><td><table>
<tr>

<td>
<table>
<tr>
<td>
<table>
<tr>
<td><table>
<tr>
<td>
<table>
<tr>
<td>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table>
<tr>
<td> <table>
<tr>
<td>Formulario 1</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td> Por favor complete este formulario y en breve nos pondremos
en contacto con usted:<br/>
<br/> <form action="formulari_medi_ambient2.php" method="post">
<table>
<tr>
<td>* Nombre y Apellidos:<br/>
<input type="text" name="nombre" size="127" id="dades" /></td>
</tr>
<tr>
<td>* Empresa:<br/>
<input type="text" name="empresa" size="127" id="dades" /></td>
</tr>
<tr>
<td>* Dirección:<br/>
<input type="text" name="direccion" size="62" id="dades" /></td>
<td>* Código postal:<br/>
<input type="text" name="codigo_postal" size="62" id="dades" /></td>
</tr>
<tr>
<td>* Localidad:<br/>
<input type="text" name="localidad" size="62" id="dades" /></td>
<td>* País:<br/>
<input type="text" name="pais" size="62" id="dades" /></td>
</tr>
<tr>
<td>* Teléfono:<br/>
<input type="text" name="telefono" size="62" id="dades" /></td>
<td>Fax:<br/>
<input type="text" name="fax" size="62" id="dades" /></td>
</tr>
<tr>
<td>* E-mail:<br/>
<input type="text" name="mail" size="127" id="dades" /></td>
</tr>
</table>
<br/>
<table>
<tr>
<td>¿Cómo nos conoció?<br/>
<select name="quien[]" multiple="multiple" size="6" id="como">
<option value="Eventos/Congreso">Eventos/Congreso</option>
<option value="Google">Google</option>
<option value="Otros buscadores">Otros buscadores</option>
<option value="Publicidad">Publicidad</option>
<option value="Por un cliente">Por un cliente</option>
<option value="Otros">Otros</option>
</select>
<br/>
(Para multiselección: Ctrl + clic)<br/>
<br/> </td>
</tr>
</table>
<br/>
<br/>
(Los campos marcados con un (*) son obligatorios)<br/>
<input type="submit" value="Continuar" name="submit" />
&nbsp;
<input type="reset" value="Borrar datos" name="reset" />
</form></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr></table>
</body>
</html>
Este es el primer formulario y que pasa las variables al segundo