Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/01/2009, 10:21
KingColt
 
Fecha de Ingreso: febrero-2008
Mensajes: 303
Antigüedad: 16 años, 2 meses
Puntos: 2
Archivo adjunto en envio de mensaje con php

Bueno mi codigo funciona biense envia el mensaje correctamente ahora necesito un campo tipo file en el formulario para subir y enviar un archivo adjunto que debi hacer?
Que debo agregarle a mi codigo php?, hace tiempo no utilizo php y no recuerdo espero se tomen un 1 minuto para ayudarme
form.php
Código PHP:
<html>
<
body>
<
form action="enviar.php" method="POST">
Destinatario<br>
<
input type="text" name="target" size="30" maxlength="30" value=""><p>
Email remitente:<BR>
<
input type="text" name="email" size="20" maxlength="30"><BR>
Título:<BR>
<
input type="text" name="titulo" size="20" maxlength="30"><BR>
Texto del email:<BR>
<
textarea name="mensaje"></textarea>
<
BR>
<
INPUT type="submit" VALUE="Enviar">
</
FORM
</
body>
</
html
enviar.php
Código PHP:
<?
//$nombre= $_POST['nombre'];
$email $_POST['email'];
$titulo$_POST['titulo'];
//$mensaje = $_POST['mensaje'];

$headers "MIME-Version: 1.0 \r\n";  
$headers .= "Content-type: text/html; charset=iso-8859-1 \r\n"
$headers .= "From: $email \r\n";   
//$headers .= "Return-path: $nombre <$email> \r\n"; 
$headers .= "X-Priority: 1 \r\n";  
//$headers .= "X-MSMail-Priority: High \r\n";  
//$headers .= "X-Mailer: PHP/".phpversion()." \n";

$mensaje 'CONTENIDO DE MI MENSAJE';
if (isset(
$email)):
# la dirección electrónica a la que enviar el email
$target$_POST['target'];

mail($target,$titulo,$mensaje,$headers);
endif;
?>
saludos