Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/05/2009, 12:51
cc1234
 
Fecha de Ingreso: septiembre-2007
Mensajes: 9
Antigüedad: 16 años, 5 meses
Puntos: 0
FormularioWeb en PHP

Hola, estoy intentando hacer un formulario para mi web y lo tengo casi resuelto, pero me gustaria que cuando envia el mail por el servidor en lugar de imprimir un mensaje en pantalla con la funcion "echo" lo haga a una direccion web. El codigo de mi formulario es el siguiente:

Código:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nombre</title>
</head>




<body>
	
<? 
if (!$HTTP_POST_VARS){ 
?> 
<form action="envia_form_php.php" method=post>

<table border="0" width="100%" id="table1">
		<tr>
			<td width="74"><font face="Tahoma" color="#800000">Nombre:</font></td>
			<td>
			<input type="text" name="Nombre" size="20" value="Click aquí para agregar su nombre"></td>
		</tr>
		<tr>
			<td width="74"><font face="Tahoma" color="#800000">Apellido:</font></td>
			<td>
			<input type="text" name="Apellido" size="20" value="Click aquí para agregar su apellido"></td>
		</tr>
		<tr>
			<td width="74"><font face="Tahoma" color="#800000">e-Mail:</font></td>
			<td>
			<input type="text" name="Mail" size="29" value="Click aquí para agregar su e-mail"></td>
		</tr>
		<tr>
			<td width="74"><font face="Tahoma" color="#800000">Edad:</font></td>
			<td>
			<input type="text" name="Edad" size="3"></td>
		</tr>
		<tr>
			<td width="74"><font face="Tahoma" color="#800000">Sexo:</font></td>
			<td>&nbsp; <input type="radio" value="V1" checked name="SexoM">Masculino&nbsp;&nbsp;
			<input type="radio" name="SexoF" value="V2">Femenino</td>
		</tr>
		<tr>
			<td width="74"><font face="Tahoma" color="#800000">Colegio:</font></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="74"><font face="Tahoma" color="#800000">Grado:</font></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td width="74"><font face="Tahoma" color="#800000">País:</font></td>
			<td><select size="1" name="Pais">
			<option>Argentina</option>
			<option>Bolivia</option>
			<option>Chile</option>
			<option>Uruguay</option>
			</select></td>
		</tr>
	</table>
	<table cellpadding="0" cellspacing="0" width="908" height="19">
	
		<tr>
			<td width="908" height="19"></td>
		</tr>
	</table>
	<table cellpadding="0" cellspacing="0" width="907">
	
		<tr>
			<td height="25" valign="top"><font face="Tahoma" color="#800000">¿En 
			qué área o áreas de la investigación te interesa participar?</font></td>
		</tr>
	</table>
	<div align="left">
		<table cellpadding="0" cellspacing="0" width="907" height="19" align="left">
		
			<tr>
				<td height="19" width="114" rowspan="2">&nbsp;</td>
				<td height="19" width="793" rowspan="2" valign="top">
				<font face="Tahoma">
				<input type="checkbox" name="Encuesta1" value="ON"> Recabar 
				datos<br>
				<input type="checkbox" name="Encuesta2" value="ON"> 
				Experimentación<br>
				<input type="checkbox" name="Encuesta3" value="ON"> Elaboración 
				de conclusiones<br>
				<input type="checkbox" name="Encuesta4" value="ON"> Estadísticas 
				de resultado</font></td>
			</tr>
		</table>
		<p>&nbsp;</div>
	<p>&nbsp;</p>
	<table cellpadding="0" cellspacing="0" width="907">

		<tr>
			<td height="25"><font face="Tahoma" color="#800000">Cuéntanos sobre 
			que te gustaría investigar</font></td>
		</tr>
	</table>
	<table cellpadding="0" cellspacing="0" width="907">

		<tr>
			<td height="30">
			<textarea rows="10" name="Comentario" cols="45">Ingrese su comentario aquí</textarea></td>
		</tr>
	</table>
	<p><input type="submit" value="Enviar" name="B1"><input type="reset" value="Restablecer" name="B2"></p>
	
	</form> 
<? 
}else{ 
	$cuerpo = "Formulario enviado\n"; 
	$cuerpo .= "Nombre: " . $HTTP_POST_VARS["Nombre"] . "\n"; 
	$cuerpo .= "Apellido: " . $HTTP_POST_VARS["Apellido"] . "\n";
	$cuerpo .= "Email: " . $HTTP_POST_VARS["Mail"] . "\n";
	$cuerpo .= "Email: " . $HTTP_POST_VARS["Edad"] . "\n";
	$cuerpo .= "Sexo: " . $HTTP_POST_VARS["SexoF"] . "\n";
	$cuerpo .= "Pais: " . $HTTP_POST_VARS["Pais"] . "\n";
	$cuerpo .= "Encuesta: " . $HTTP_POST_VARS["Encuesta1"] . "\n";
	$cuerpo .= "Encuesta: " . $HTTP_POST_VARS["Encuesta2"] . "\n";
	$cuerpo .= "Encuesta: " . $HTTP_POST_VARS["Encuesta3"] . "\n";
	$cuerpo .= "Encuesta: " . $HTTP_POST_VARS["Encuesta4"] . "\n";
	$cuerpo .= "Comentario: " . $HTTP_POST_VARS["Comentario"] . "\n";
	
	//mando el correo... 
    mail("miMail","Formulario recibido",$cuerpo); 

    //doy las gracias por el envío 
    echo "Gracias por rellenar el formulario. Se ha enviado correctamente.";

} 
?> 


</body>

</html>
He leido que se puede hacer con la funcion header() de PHP, pero no logro saber donde la tengo que incluir. Espero puedan ayudarme, muchas gracias desde ya!