Ver Mensaje Individual
  #15 (permalink)  
Antiguo 15/01/2008, 19:26
Avatar de Bile
Bile
 
Fecha de Ingreso: diciembre-2006
Mensajes: 786
Antigüedad: 17 años, 4 meses
Puntos: 9
Re: formulario enviar a un amigo

a ver... prueba este codigo.

formulario.html

Código PHP:
<html>
<
head>
<
title>Formulario de Contacto</title>
</
head>

<
body>
<
form id="form1" name="form1" method="post" action="enviar.php">
<
p>Nombre:<br />
<
label>
<
input name="nombre" type="text" id="nombre" />
</
label>
<
br />
Telefono:<br />
<
input name="telefono" type="text" id="telefono" />
<
br />
Email:<br />
<
input name="email" type="text" id="email" />
<
br>
Enviar email al amigo:<br>
<
input name="emailfriend" type="text" id="emailfriend" /> 
<
br />
Mensaje:<br />
<
textarea name="mensaje" id="mensaje"></textarea>
<
br />
<
label>
<
input type="submit" name="Submit" value="Enviar Formulario" />
</
label>
</
p>
</
form>
</
body>
</
html
enviar.php

Código PHP:
<?php

$mail
='[email protected]';


$nombre $_POST['nombre'];
$telefono $_POST['telefono'];
$email $_POST['email'];
$emailfriend $_POST['emailfriend'];
$mensaje $_POST['mensaje'];

$thank="thanks.php";

$copia "$mail,$emailfriend";

$message "
nombre:"
.$nombre."
telefono:"
.$telefono."
email:"
.$email."
emailfriend:"
.$emailfriend."
mensaje:"
.$mensaje."";

if (
mail($copia,"Formulario de Consulta",$message))
Header ("Location: $thank");

?>