Ver Mensaje Individual
  #8 (permalink)  
Antiguo 10/06/2011, 08:58
Avatar de memoadian
memoadian
Colaborador
 
Fecha de Ingreso: junio-2009
Ubicación: <?php echo 'México'?>
Mensajes: 3.696
Antigüedad: 14 años, 11 meses
Puntos: 641
Respuesta: Duda con codigo PHP para enviar formulario

las variables no pueden escribirse así:

$mi variable

debe ser así:

$mi_variable, es decir no permiten espacios

y la variable $message nunca la cierras con un ;

Código PHP:
Ver original
  1.  
  2. $categoria = $_POST ["select2"] ;
  3. $provincia = $_POST ["select"] ;
  4. $particular = $_POST ["radio"] ;
  5. $profesional = $_POST ["radio2"] ;
  6. $nombre = $_POST ["textfield3"] ;
  7. $apellidos = $_POST ["textfield"] ;
  8. $email = $_POST ["textfield9"] ;
  9. $contraseña = $_POST ["textfield4"] ;
  10. $repetir_contraseña = $_POST ["textfield12"];
  11. $ciudad_del_anunciante = $_POST ["textfield10"] ;
  12. $zona_de_cobertura = $_POST ["textfield11"] ;
  13. $telefono = $_POST ["textfield2"] ;
  14. $dia = $_POST ["select3"] ;
  15. $mes = $_POST ["select4"] ;
  16. $año = $_POST ["select5"] ;
  17. $dni = $_POST ["textfield5"] ;
  18. $titulo_anuncio = $_POST ["textfield6"] ;
  19. $descripcion = $_POST ["textfield7"] ;
  20. $imagen = $_POST ["fileField"] ;
  21. $acepta_condiciones_de_uso = $_POST ["checkbox"] ;
  22.  
  23. $thank="gracias por tu anuncio.html" ;
  24.  
  25. $message = "
  26. categoria: " .$select2."
  27. provincia: " .$select."
  28. particular: " .$radio."
  29. profesional: " .$radio2."
  30. nombre: " .$textfield3."
  31. apellidos: " .$textfield."
  32. email: " .$textfield9."
  33. contraseña: " .$textfield4."
  34. repetir contraseña: " .$textfield12."
  35. ciudad del anunciante: " .$textfield10."
  36. zona de cobertura: " .$textfield11."
  37. telefono: " .$textfield2."
  38. dia: " .$select3."
  39. mes: " .$select4."
  40. año: " .$select5."
  41. dni: " .$textfield5."
  42. titulo anuncio: " .$textfield6."
  43. descripcion: " .$textfield7."
  44. imagen: " .$fileField."
  45. acepta condiciones de uso: " .$checkbox;
  46.  
  47. if (mail ($mail, "nuevo anuncio", $message) )
  48. Header ("Location: $thank") ;