Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/04/2010, 11:52
Avatar de DragonX
DragonX
Colaborador
 
Fecha de Ingreso: mayo-2002
Ubicación: Funkyland
Mensajes: 8.433
Antigüedad: 21 años, 10 meses
Puntos: 177
Adjuntar img a formulario

Hola amigos, estoy intentando adjuntar una imagen a un formulario, pero la verdad no doy pie con bola.

Intente poniendo esto:

Código PHP:
Ver original
  1. <?php
  2. $Archivo = $_FILES['Archivo']['tmp_name'];
  3. $Archivo_name = "curriculum-".$_FILES['Archivo']['name'];
  4. $mail-> AddAttachment($Archivo,$Archivo_name);
  5. ?>
  6.  
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
  9.   <head>  
  10.   </head>
  11.   <body>
  12. <form method="post" action="mailer.php" id="commentForm" name="commentForm">
  13.             <fieldset>
  14.               <div>
  15.                 <label for="Nombre">Nombre:<span class="obligatorio">*</span></label>
  16.                 <input type="text" name="Nombre" id="Nombre" class="required" />
  17.               </div>
  18.               <div>
  19.                 <label for="Pais">Pa&iacute;s:</label>
  20.                 <input type="text" name="Pais" id="Pais" />
  21.               </div>
  22.               <div>
  23.                 <label for="Email">Email:<span class="obligatorio">*</span></label>
  24.                 <input type="text" name="Email" id="Email" class="required email" />
  25.               </div>
  26.               <div>
  27.                 <label for="Archivo">Archivo:</label>
  28.                 <input type="file" name="Archivo" id="Archivo" />
  29.               </div>              
  30.               <div>
  31.                 <label for="Asunto">Asunto:<span class="obligatorio">*</span></label>
  32.                 <input type="text" name="Asunto" id="Asunto" class="required" />
  33.               </div>
  34.               <div>
  35.                 <label for="Mensaje">Mensaje:</label>
  36.                 <textarea name="Mensaje" id="Mensaje" rows="6" cols="20"></textarea><br />
  37.               </div>
  38.               <input type="submit" name="submit" value="Enviar" class="enviabtn" />
  39.             </fieldset>
  40.           </form>            
  41. </body>
  42. </html>

y mi archivo mailes es el siguiente:

Código PHP:
Ver original
  1. <?PHP
  2. $to = "xxxxxxx"; //
  3. $subject = "xxxxxx";
  4. $headers = "xxxxxx";
  5. $forward = 0;
  6. $location = "";
  7.  
  8. $date = date ("l, F jS, Y");
  9. $time = date ("h:i A");
  10.  
  11.  
  12.  
  13. $msg = "$date at $time.\n\n";
  14.  
  15. if ($_SERVER['REQUEST_METHOD'] == "POST") {
  16.     foreach ($_POST as $key => $value) {
  17.         $msg .= ucfirst ($key) ." : ". $value . "\n";
  18.     }
  19. }
  20. else {
  21.     foreach ($_GET as $key => $value) {
  22.         $msg .= ucfirst ($key) ." : ". $value . "\n";
  23.     }
  24. }
  25.  
  26. mail($to, $subject, $msg, $headers);
  27. if ($forward == 1) {
  28.     header ("Location:$location");
  29. }
  30. else {
  31.     //echo "Thank you for submitting our form. We will get back to you as soon as possible.";
  32.     header("Location: ok.php");
  33. }
  34.  
  35. ?>


pero no anda ni para atras, me da este error:

Cita:
Fatal error: Call to a member function on a non-object in /nfs/c06/h02/mnt/89312/domains/urbanchip.com/html/de-psd-a-html/index.php on line 4
si me pueden dar una mano, se los agradecería muchisimo!
unabrazo
__________________
Desarrollos dosLotos
Calendario Maya, Meditación, Osho

Última edición por DragonX; 15/04/2010 a las 11:54 Razón: me falto poner el codigo del mailer.