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

Problema con Form y PHP

Estas en el tema de Problema con Form y PHP en el foro de Flash y Actionscript en Foros del Web. hola, tengo un problema con un formulario que al clickear en enviar me manda todos los datos a mi mail por php. El mail me ...
  #1 (permalink)  
Antiguo 04/06/2008, 10:48
 
Fecha de Ingreso: febrero-2004
Mensajes: 64
Antigüedad: 20 años, 2 meses
Puntos: 0
Problema con Form y PHP

hola, tengo un problema con un formulario que al clickear en enviar me manda todos los datos a mi mail por php.

El mail me llega barbaro... pero el contenido, me llega asi:

El siguiente mail fue enviado el 03.06.2008 a las 16:58:01:
----------------------------------------------------------------------------
Name: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Tahoma\" SIZE=\"10\" COLOR=\"#601F13\" LETTERSPACING=\"0\" KERNING=\"0\">Santiago TATO 2222</FONT></P></TEXTFORMAT>

Email: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Tahoma\" SIZE=\"10\" COLOR=\"#601F13\" LETTERSPACING=\"0\" KERNING=\"0\">lkjlk</FONT></P></TEXTFORMAT>

Company: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Tahoma\" SIZE=\"10\" COLOR=\"#601F13\" LETTERSPACING=\"0\" KERNING=\"0\">lkj</FONT></P></TEXTFORMAT>

Phone: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Tahoma\" SIZE=\"10\" COLOR=\"#601F13\" LETTERSPACING=\"0\" KERNING=\"0\">lkjlkj</FONT></P></TEXTFORMAT> City: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Tahoma\" SIZE=\"10\" COLOR=\"#601F13\" LETTERSPACING=\"0\" KERNING=\"0\">lkjl</FONT></P></TEXTFORMAT>

State: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Tahoma\" SIZE=\"10\" COLOR=\"#601F13\" LETTERSPACING=\"0\" KERNING=\"0\">kjlk</FONT></P></TEXTFORMAT>

Zip: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Tahoma\" SIZE=\"10\" COLOR=\"#601F13\" LETTERSPACING=\"0\" KERNING=\"0\">jlkjl</FONT></P></TEXTFORMAT>

----------------------------------------------------------------------------

Message: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Tahoma\" SIZE=\"10\" COLOR=\"#601F13\" LETTERSPACING=\"0\" KERNING=\"0\">kjlkjk</FONT></P></TEXTFORMAT>



porque puede ser?

el codigo del boton enviar es el siguiente:

Código:
on (release) {
	if (names != "" and email != "" and company != "" and phone !="" and addres !="" and city !="" and states !="" and zip !="" and messages !="") {
		loadVariables("form.php", "_root", "POST");
	    gotoAndPlay("salida");
	} else {
		gotoAndPlay("salida2")
	}
}

y el php tiene el siguiente codigo:

Código:
<?php
#
$names = $_POST['names'];
$email = $_POST['email'];
$company = $_POST['company'];
$phone = $_POST['phone'];
$city = $_POST['city'];
$states = $_POST['states'];
$zip = $_POST['zip'];
$messages = $_POST['messages'];
$MailTo="ACA PUSE MI MAIL";
#
# Formating Date   ############################################################
#
$nowDay=date("d.m.Y");
$nowClock=date("H:i:s");
#
# Formating Body content ######################################################
#
$FormContent="
Day:$nowDay\n
Time:$nowClock:\n\n
----------------------------------------------------------------------------\n
Name: $names\n
Email: $email\n
Company: $company\n
Phone: $phone\n
City: $city\n
State: $states\n
Zip: $zip\n
----------------------------------------------------------------------------\n
Message: $messages\n
";
#
#
mail($MailTo, "$Subject (Web Form)", $FormContent, "From: $email");
#
#


Si alguien me puede ayudar a ver cual es el error , se los agradeceria mucho.

Espero su respuesta, gracias!
  #2 (permalink)  
Antiguo 04/06/2008, 10:55
Avatar de Diegoazul  
Fecha de Ingreso: mayo-2007
Ubicación: { Dash Berlin }
Mensajes: 1.879
Antigüedad: 16 años, 10 meses
Puntos: 67
Respuesta: Problema con Form y PHP

te recomiendo usar este http://www.maestrosdelweb.com/editorial/fflashphpform/

y usar LoadVars ya que loadVariables, como ves en tu correo es ineficiente y antiguo.
  #3 (permalink)  
Antiguo 11/06/2008, 10:57
 
Fecha de Ingreso: febrero-2004
Mensajes: 64
Antigüedad: 20 años, 2 meses
Puntos: 0
Respuesta: Problema con Form y PHP

Cita:
Iniciado por Diegoazul Ver Mensaje
te recomiendo usar este http://www.maestrosdelweb.com/editorial/fflashphpform/

y usar LoadVars ya que loadVariables, como ves en tu correo es ineficiente y antiguo.
Hola como andas!!, muchas gracias por tu ayuda!

Segui tu consejo, y con el link que me diste arme el formulario... pero ahora lo subi al servidor para probarlo.. y cuando completo todo el formulario y lo envio, me dice "Server Problems, try again later".... y no encuentro cual es el error y el motivo por cual me dice eso...

este es mi nuevo codigo php:

Código:
<?php
            if(isset($_POST["names"]) && isset($_POST["email"]) isset($_POST["company"])
            isset($_POST["phone"]) isset($_POST["address"]) isset($_POST["city"]) 
			isset($_POST["states"]) isset($_POST["zip"]) isset($_POST["menssages"])){
            $fecha = date("d-M-y H:i");
            $mymail = "ACA PUSE MI MAIL";
            $subject = "Web JOT Law";
            $contenido = $names." Name:\n";
			$contenido = $email." Email:\n";
			$contenido = $company." Company:\n";
			$contenido = $phone." Phone:\n";
			$contenido = $address." Address:\n";
			$contenido = $states." State:\n";
			$contenido = $city." City:\n";
			$contenido = $zip." Zip:\n";
            $contenido .= $message."Message:\n\n";
            $contenido .= "the message wa sent on ".$fecha;
            $header = "From:".$email."\nReply-To:".$email."\n";
            $header .= "X-Mailer:PHP/".phpversion()."\n";
            $header .= "Mime-Version: 1.0\n";
            $header .= "Content-Type: text/plain";
            mail($mymail, $subject, utf8_decode($contenido) ,$header);
            echo "&estatus=ok&";
            }
?>

y este es el codigo q puse en el FLA:

Código:
enviar = function () {
    if (email.text.length && names.length && company.length && phone.length && address.length && city.length && states.length && zip.length && messages.length) {
        if (email.text.indexOf("@") != -1 && email.text.indexOf(".") != -1) {
            form_lv = new LoadVars();
            form_lv.Name = names.text;
            form_lv.Email = email.text;
			form_lv.Company = company.text;
			form_lv.Phone = phone.text;
			form_lv.Address = address.text;
            form_lv.City = city.text;
            form_lv.State = states.text;
			form_lv.Zip = zip.text;
			form_lv.Message = messages.text;
            form_lv.sendAndLoad("http://www.midominio.com.ar/web_prueba/send.php", form_lv, "POST");
            status_txt.text = "Sending message...";
            names.text = "";
            email.text = "";
            company.text = "";
			phone.text = "";
			address.text = "";
			city.text = "";
			states.text = "";
			zip.text = "";
			    form_lv.onLoad = function() {
                if (this.estatus == "ok") {
                     status_txt.text = "Your message has been sent...";
                     names.text = "";
                     email.text = "";
                     company.text = "";
			         phone.text = "";
			         address.text = "";
			         city.text = "";
			         states.text = "";
			         zip.text = "";
                } else {
                    status_txt.text = "Server problems, try again please";
                }
            };
        } else {
            status_txt.text = "Wrong email";
        }
    } else {
        status_txt.text = "Please, fill in the form before sending" 
    }
};
enviar_btn.onRelease = enviar;

Espero tu respuesta, muchas gracias!
  #4 (permalink)  
Antiguo 11/06/2008, 12:51
Avatar de Diegoazul  
Fecha de Ingreso: mayo-2007
Ubicación: { Dash Berlin }
Mensajes: 1.879
Antigüedad: 16 años, 10 meses
Puntos: 67
Respuesta: Problema con Form y PHP

ponlo asi a ver que tal.
Código PHP:
<?php
            
if(isset($_POST["names"]) && isset($_POST["email"])&& isset($_POST["company"]) &&isset($_POST["phone"]) &&isset($_POST["address"])&& isset($_POST["city"]) &&isset($_POST["states"])&&isset($_POST["zip"]) && isset($_POST["menssages"])){
            
$fecha date("d-M-y H:i");
            
$mymail "ACA PUSE MI MAIL";
            
$subject "Web JOT Law";
            
$contenido $names." Name:\n";
            
$contenido $email." Email:\n";
            
$contenido $company." Company:\n";
            
$contenido $phone." Phone:\n";
            
$contenido $address." Address:\n";
            
$contenido $states." State:\n";
            
$contenido $city." City:\n";
            
$contenido $zip." Zip:\n";
            
$contenido .= $message."Message:\n\n";
            
$contenido .= "the message wa sent on ".$fecha;
            
$header "From:".$email."\nReply-To:".$email."\n";
            
$header .= "X-Mailer:PHP/".phpversion()."\n";
            
$header .= "Mime-Version: 1.0\n";
            
$header .= "Content-Type: text/plain";
            
mail($mymail$subjectutf8_decode($contenido) ,$header);
            echo 
"&estatus=ok&";
            }
?>
sino funciona vienes.
  #5 (permalink)  
Antiguo 11/06/2008, 13:16
 
Fecha de Ingreso: febrero-2004
Mensajes: 64
Antigüedad: 20 años, 2 meses
Puntos: 0
Respuesta: Problema con Form y PHP

Hola! gracias por la ayuda.

Lo acabo de probar asi como me dijiste, pero me sigue pasando lo mismo.
  #6 (permalink)  
Antiguo 11/06/2008, 13:46
Avatar de Diegoazul  
Fecha de Ingreso: mayo-2007
Ubicación: { Dash Berlin }
Mensajes: 1.879
Antigüedad: 16 años, 10 meses
Puntos: 67
Respuesta: Problema con Form y PHP

cambia names email etc...
Código PHP:
              if(isset($_POST["names"]) && isset($_POST["email"])&& isset($_POST["company"]) &&isset($_POST["phone"]) &&isset($_POST["address"])&& isset($_POST["city"]) &&isset($_POST["states"])&&isset($_POST["zip"]) && isset($_POST["menssages"])){
            
$fecha date("d-M-y H:i");
            
$mymail "ACA PUSE MI MAIL";
            
$subject "Web JOT Law";
            
$contenido $names." Name:\n";
            
$contenido $email." Email:\n";
            
$contenido $company." Company:\n";
            
$contenido $phone." Phone:\n";
            
$contenido $address." Address:\n";
            
$contenido $states." State:\n";
            
$contenido $city." City:\n";
            
$contenido $zip." Zip:\n"




por estos que estan en flash:
Código:
form_lv.Name = "hjolas";
form_lv.Email = "hjolas";
form_lv.Company = "hjolas";
form_lv.Phone = "hjolas";
form_lv.Address = "hjolas";
form_lv.City = "hjolas";
form_lv.State = "hjolas";
form_lv.Zip = "hjolas";
quedaria asi mas o menos:
Código:
 if(isset($_POST["Name"]) && isset($_POST["Email"])   etc.....
etc
  #7 (permalink)  
Antiguo 11/06/2008, 14:07
 
Fecha de Ingreso: febrero-2004
Mensajes: 64
Antigüedad: 20 años, 2 meses
Puntos: 0
Respuesta: Problema con Form y PHP

bueno me quedaron asi los codigos:

PHP:

Código:
<?php 
            if(isset($_POST["Name"]) && isset($_POST["Email"])&& isset($_POST["Company"]) &&isset($_POST["Phone"]) &&isset($_POST["Address"])&& isset($_POST["City"]) &&isset($_POST["State"])&&isset($_POST["Zip"]) && isset($_POST["Menssage"])){ 
            $fecha = date("d-M-y H:i"); 
            $mymail = "[email protected]"; 
            $subject = "Web JOT Law"; 
            $contenido = $names." Name:\n"; 
            $contenido = $email." Email:\n"; 
            $contenido = $company." Company:\n"; 
            $contenido = $phone." Phone:\n"; 
            $contenido = $address." Address:\n"; 
            $contenido = $states." State:\n"; 
            $contenido = $city." City:\n"; 
            $contenido = $zip." Zip:\n"; 
            $contenido .= $message."Message:\n\n"; 
            $contenido .= "the message wa sent on ".$fecha; 
            $header = "From:".$email."\nReply-To:".$email."\n"; 
            $header .= "X-Mailer:PHP/".phpversion()."\n"; 
            $header .= "Mime-Version: 1.0\n"; 
            $header .= "Content-Type: text/plain"; 
            mail($mymail, $subject, utf8_decode($contenido) ,$header); 
            echo "&estatus=ok&"; 
            } 
?>

FLASH:

Código:
enviar = function () {
    if (email.text.length && names.length && company.length && phone.length && address.length && city.length && states.length && zip.length && messages.length) {
        if (email.text.indexOf("@") != -1 && email.text.indexOf(".") != -1) {
            form_lv = new LoadVars();
            form_lv.Name = names.text;
            form_lv.Email = email.text;
			form_lv.Company = company.text;
			form_lv.Phone = phone.text;
			form_lv.Address = address.text;
            form_lv.City = city.text;
            form_lv.State = states.text;
			form_lv.Zip = zip.text;
			form_lv.Message = messages.text;
            form_lv.sendAndLoad("http://MIDOMINIO.com/pruebaweb/send.php", form_lv, "POST");
            status_txt.text = "Sending message...";
            names.text = "";
            email.text = "";
            company.text = "";
			phone.text = "";
			address.text = "";
			city.text = "";
			states.text = "";
			zip.text = "";
			    form_lv.onLoad = function() {
                if (this.estatus == "ok") {
                     status_txt.text = "Your message has been sent...";
                     names.text = "";
                     email.text = "";
                     company.text = "";
			         phone.text = "";
			         address.text = "";
			         city.text = "";
			         states.text = "";
			         zip.text = "";
                } else {
                    status_txt.text = "Server problems, try again please";
                }
            };
        } else {
            status_txt.text = "Wrong email";
        }
    } else {
        status_txt.text = "Please, fill in the form before sending" 
    }
};
enviar_btn.onRelease = enviar;

pero cuando clickeo en enviar me sigue diciendo "Server problemsn, try again please"... =(
  #8 (permalink)  
Antiguo 11/06/2008, 14:22
Avatar de Diegoazul  
Fecha de Ingreso: mayo-2007
Ubicación: { Dash Berlin }
Mensajes: 1.879
Antigüedad: 16 años, 10 meses
Puntos: 67
Respuesta: Problema con Form y PHP

en la liga del tutorial al principio hay una parte donde tmeister te dice como saber si tienes php en tu server , checalo fijate si manda email a tu correo.


tambien te falto cambiarle las variables aqui

Código PHP:
 $contenido $Name." Name:\n";
            
$contenido $email." Email:\n";
            
$contenido $company." Company:\n";
            
$contenido $phone." Phone:\n";
            
$contenido $address." Address:\n";
            
$contenido $states." State:\n";
            
$contenido $city." City:\n";
            
$contenido $zip." Zip:\n"
}


osea
Código PHP:
  $contenido $Name." Name:\n";
  
$contenido $Email." Email:\n"
etc...
  #9 (permalink)  
Antiguo 12/06/2008, 15:31
 
Fecha de Ingreso: febrero-2004
Mensajes: 64
Antigüedad: 20 años, 2 meses
Puntos: 0
Respuesta: Problema con Form y PHP

hola diego!.. si ya hice la prueba y mi servidor s tiene php.

De hecho, intente subir el ejemplo del tutorial... pero me terminaba en el mismo error "Problemas con el servidor, intente nuevamente"

Habra algun error en el tutorial??

saludos.
  #10 (permalink)  
Antiguo 19/06/2008, 12:15
 
Fecha de Ingreso: febrero-2004
Mensajes: 64
Antigüedad: 20 años, 2 meses
Puntos: 0
Respuesta: Problema con Form y PHP

No conoces algun otro ejemplo de flash form con php q te envie los datos al mail, para q pueda probarlo? estuve probando este en varios servidores, todos soportan php, pero todos me hacen el mismo error... y logro encontrar la falla.

gracias!
  #11 (permalink)  
Antiguo 22/06/2008, 12:52
Avatar de Diegoazul  
Fecha de Ingreso: mayo-2007
Ubicación: { Dash Berlin }
Mensajes: 1.879
Antigüedad: 16 años, 10 meses
Puntos: 67
Respuesta: Problema con Form y PHP

a mi me funciona ese perfecto , lo que debes hacer es modificar como te dije el de el ejemplo, y cuando funcione ahora si lo adaptas al tuyo. pero te repito primero prueba el del ejemplo.
  #12 (permalink)  
Antiguo 04/08/2008, 11:46
Avatar de esdebon  
Fecha de Ingreso: agosto-2008
Ubicación: México
Mensajes: 167
Antigüedad: 15 años, 8 meses
Puntos: 18
Respuesta: Problema con Form y PHP

Si el primero te funcionaba no se para que te pusiste a armar otro.

Los textos de: "<TEXTFORMAT LEADING=..." los genera la casilla de texto de flash cuando esta habilitada la opcion de "REnder text as HTML" solo tienes que "deseleccionar" la casilla y listo.
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 22:55.