Foros del Web » Creando para Internet » Flash y Actionscript »

Problemas con Formulario flash

Estas en el tema de Problemas con Formulario flash en el foro de Flash y Actionscript en Foros del Web. Hola, llevo semanas peleándome con el formulario y no hay manera de que se envíe. Ya he comprobado que el servidor funciona en php y ...
  #1 (permalink)  
Antiguo 25/04/2010, 12:01
 
Fecha de Ingreso: marzo-2006
Mensajes: 5
Antigüedad: 18 años, 11 meses
Puntos: 1
Problemas con Formulario flash

Hola, llevo semanas peleándome con el formulario y no hay manera de que se envíe. Ya he comprobado que el servidor funciona en php y admite smtp. En principio no me da ningún error, pero el formulario nunca llega a enviarse. ¿Qué puede ser?? ayudaaa!!!

Código PHP:
Ver original
  1. <?php
  2. //-----------------Getting data sent by flash---------------------
  3. foreach ($_POST as $key => $value){
  4.  
  5.         if ($key != 'mail_to' && $key != 'smtp_server' && $key != 'smtp_port' && $key != 'mail_from' && $key != 'mail_subject' && $key != 'plain_text'){
  6.    
  7.             $mail_body .= '<b>'.str_replace('_',' ',$key).'</b>:<br/>';
  8.    
  9.             $mail_body .= ''.stripslashes($value).'<br/>';
  10.         }
  11. }
  12. //-----------------------------------------------------------------
  13.  
  14.  
  15.  
  16. $message = '<html><body>'.$mail_body.'</body></html>'; //  mail body
  17.  
  18. //------------if plain text is set to true removing html tags------
  19. if ($_POST['plain_text']=='true') {
  20.  
  21.     $message = str_replace('<br/>',"\r\n", $message);
  22.  
  23.     $message = strip_tags($message);
  24.  
  25. //------------------------------------------------------------------
  26. } else {
  27. //----otherwise composing message headers---------------------------
  28.     $headers  = 'MIME-Version: 1.0' . "\r\n";
  29.    
  30.     $headers .= 'Content-type: text/html; charset=windows-1251' . "\r\n";
  31. //------------------------------------------------------------------
  32. }
  33.  
  34. //------------setting conf data-------------------------------------
  35. $to = $_POST['mail_to'];
  36.  
  37. $from = $_POST['mail_from'];
  38.  
  39. $subject = $_POST['mail_subject'];
  40.  
  41. $smtp_server = $_POST['smtp_server'];
  42.  
  43. $smtp_port = $_POST['smtp_port'];
  44. //------------------------------------------------------------------
  45.  
  46. //---------setting header info--------------------------------------
  47.  
  48.  
  49. $headers .= 'From:' .$from;
  50. //------------------------------------------------------------------
  51.  
  52.  
  53. if (mail($to, $subject, $message, $headers)){ // sending mail
  54.  
  55.     print('&mail=1');  //succes
  56.  
  57. } else {
  58.  
  59.     print('&mail=0');//failure
  60.  
  61. }
  62.  
  63. ?>
Código XML:
Ver original
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <contactFormConfiguration>
  4.  
  5.     <emailTo>[email protected]</emailTo>
  6.    
  7.     <serverProcessorType>php</serverProcessorType>
  8.    
  9.     <serverProcessorFileName>contact</serverProcessorFileName>
  10.    
  11.     <validateRequiredOnly>false</validateRequiredOnly>
  12.    
  13.     <submitFormOnEnter>false</submitFormOnEnter>
  14.    
  15.     <messageSentText>Gracias por su mensaje.</messageSentText>
  16.    
  17.     <messageSentFailedText>Lo sentimos, su mensaje no puedo enviarse.</messageSentFailedText>
  18.    
  19.     <formProcessingText>enviando...</formProcessingText>
  20.    
  21.     <smtpServer>localhost</smtpServer>
  22.    
  23.     <smtpPort>25</smtpPort>
  24.    
  25.     <plainText>false</plainText>
  26.    
  27.     <emailFromSource>3</emailFromSource>
  28.    
  29.     <subjectSource>Contact Form from your site</subjectSource>
  30.    
  31.     <validationErrorMessages>  
  32.        
  33.         <message type="fieldIsRequired">{LABEL} is required.</message>
  34.        
  35.         <message type="emailNotValid">{LABEL} - is not valid email address.</message>
  36.        
  37.         <message type="minCharsLimitError">{LABEL} - The specified number of characters in a field is less than a required minimum.</message>
  38.        
  39.         <message type="reqExpError">{LABEL} - The specified string does not match with the regular expression.</message>
  40.        
  41.         <message type="biggerThanMaxError">{LABEL} - The specified number is greater than an acceptable biggest number for this field.</message>
  42.        
  43.         <message type="lowerThanMinError">{LABEL} - The specified number is lower than an acceptable lowest number for this field.</message>
  44.        
  45.         <message type="notANumberError">{LABEL} - The data is not a number.</message>
  46.        
  47.         <message type="negativeError">{LABEL} - The specified number must not be negative.</message>
  48.        
  49.         <message type="minRequirementError">{LABEL} - The minimum number of variants is not selected</message>
  50.        
  51.         <message type="maxRequirementError">{LABEL} - The number of variants selected exceeds the maximum</message>
  52.        
  53.         <message type="shouldBeEqualError">{LABEL} - values do not match</message>
  54.  
  55.         <message type="dateIsNotValidError">{LABEL} - date has wrong format</message>
  56.  
  57.     </validationErrorMessages>
  58.    
  59. </contactFormConfiguration>
Código XML:
Ver original
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <contactFormStructure>
  3.    
  4.     <formItems>
  5.  
  6.         <item id="1" label="Name" required="true">
  7.             <textToShow>Nombre*:</textToShow>
  8.         </item>
  9.  
  10.         <item id="2" label="Phone">
  11.             <textToShow>Teléfono:</textToShow>                    
  12.                         <restrict>+-.0-9</restrict>
  13.         </item>
  14.  
  15.         <item id="3" label="E-mail" required="true">
  16.             <textToShow>E-mail*:</textToShow>
  17.             <validator>EmailValidator</validator>
  18.         </item>
  19.  
  20.         <item id="4" label="Message" required="true">
  21.             <textToShow>Mensaje*:</textToShow>
  22.         </item>
  23.  
  24.     </formItems>
  25.    
  26. </contactFormStructure>
  #2 (permalink)  
Antiguo 25/04/2010, 14:08
 
Fecha de Ingreso: octubre-2007
Ubicación: Madrid, España
Mensajes: 221
Antigüedad: 17 años, 3 meses
Puntos: 5
Respuesta: Problemas con Formulario flash

es lo que tiene coger código de por ahí, que cuando falla es difícil resolverlo pq no lo conoces. En principio lo único que necesitas para enviar un formulario por correo es:
Código PHP:
Ver original
  1. $Name = "Formulario web";
  2. $email = "[email protected]";
  3. $recipient = "yo@ midominio.com";
  4. $mail_body = 'poner aquí todo el contenido';
  5. $subject = "asunto del mensaje";
  6. $header = "From: ". $Name . " <" . $email . ">\r\n";
  7.  
  8. ini_set('sendmail_from', '[email protected]');
  9.  
  10. mail($recipient, $subject, $mail_body, $header);
__________________
El camino hacia la cima es, como el viaje hacia uno mismo, una ruta en solitario.
  #3 (permalink)  
Antiguo 26/04/2010, 12:24
 
Fecha de Ingreso: marzo-2006
Mensajes: 5
Antigüedad: 18 años, 11 meses
Puntos: 1
Respuesta: Problemas con Formulario flash

Jooo :( ya se que es muy cutre, es un plantilla que compré, pero es la única manera que tenemos de hacer webs los que no sabemos hacer webs!

En finnnn he cambiado todo el archivo php por el que me has dado, pero sigue sin funcionar. ¿Los otros dos archivos los dejo tal cual? ¿Estan bien?

Gracias!!!
  #4 (permalink)  
Antiguo 27/04/2010, 00:11
 
Fecha de Ingreso: octubre-2007
Ubicación: Madrid, España
Mensajes: 221
Antigüedad: 17 años, 3 meses
Puntos: 5
Respuesta: Problemas con Formulario flash

es que es un poco más complejo, no se si tienes que dejarlos como están pq no los conozco. El código que yo te he puesto no necesita los archivos xml, esos archivos le sirven a las plantillas. Algo que tampoco has puesto es el código del flash.... Si sigues tutoriales que hay por la red verás que es más fácil hacer este tipo de cosas tu mismo, vas a aprender mucho más rápido y además te ahorraras muchos quebraderos de cabeza.

Si puedes pega la parte de flash...
__________________
El camino hacia la cima es, como el viaje hacia uno mismo, una ruta en solitario.

Etiquetas: flash, formulario
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:23.