Comunidad de diseño web y desarrollo en internet online

Funciona... Formulario de contacto flash, php, y Combobox

Citar            
MensajeEscrito el 04 Dic 2007 04:56 pm
Bueno es un Formulario de Contacto que hice ayer.... tiene los siguientes campos
Nombre (nombre)
Mail (email)
Destinatario (ComboBox con 5 opciones) (asunto)
Telefono (fono)
Comentario (mensaje)
Y UN TEXTO DINAMICO PARA LOS MENSAJES DEL FORMULARIO EN CASO DE ERROR O EXITO

ademas consta de 5 archivos php cada destinatario tiene su php

ahora el codigo esta bastante desordenado por eso pido ayuda! :(
ya que trato de optimizarlo y comienzan los problemas...:shock:

ademas si alguien me pude ayudar a modificar el codigo para ponerle las validaciones de Numero y Mail para la casilla te telefono y mail respectivamente....

creo que con eso el formulario quedaria bastante completo

CODIGO FLASH

Código :

stop();
_root.enviar.onRelease = function() {
   if (_root.nombre.text == "" || _root.mensaje.text == "" || _root.fono.text == "" || _root.email.text == "") {
      _root.respuesta.text = "El Nombre/Mensaje Son muy cortos";
   } else {
      if (_root.asunto.value == "Presidencia") {
         delete nuevomail;
         nuevomail = new LoadVars();
         nuevomail.nombre = _root.nombre.text;
         nuevomail.email = _root.email.text;
         nuevomail.asunto = _root.asunto.value;
         nuevomail.fono = _root.fono.text;
         nuevomail.mensaje = _root.mensaje.text;
         _root.respuesta.text = "Espere Porfavor";
         nuevomail.onLoad = function() {
            _root.respuesta.text = nuevomail.respuesta;
         };
         
         nuevomail.sendAndLoad("contactopresi.php",nuevomail,"POST");
      }
      
      _root.borrar.onRelease = function() {
         _root.mensaje.text="";
         _root.nombre.text="";
         _root.respuesta.text="";
      };
      
      
      if (_root.asunto.value == "Tesorería") {
         delete nuevomail;
         nuevomail = new LoadVars();
         nuevomail.nombre = _root.nombre.text;
         nuevomail.email = _root.email.text;
         nuevomail.asunto = _root.asunto.value;
         nuevomail.fono = _root.fono.text;
         nuevomail.mensaje = _root.mensaje.text;
         _root.respuesta.text = "Espere Porfavor";
         nuevomail.onLoad = function() {
            _root.respuesta.text = nuevomail.respuesta;
         };
         
         nuevomail.sendAndLoad("contactotesor.php",nuevomail,"POST");
      }
      
      _root.borrar.onRelease = function() {
         _root.mensaje.text="";
         _root.nombre.text="";
         _root.respuesta.text="";
      };
      
      
      if (_root.asunto.value == "Relaciones públicas") {
         delete nuevomail;
         nuevomail = new LoadVars();
         nuevomail.nombre = _root.nombre.text;
         nuevomail.email = _root.email.text;
         nuevomail.asunto = _root.asunto.value;
         nuevomail.fono = _root.fono.text;
         nuevomail.mensaje = _root.mensaje.text;
         _root.respuesta.text = "Espere Porfavor";
         nuevomail.onLoad = function() {
            _root.respuesta.text = nuevomail.respuesta;
         };
         
         nuevomail.sendAndLoad("contactorela.php",nuevomail,"POST");
      }
      
      _root.borrar.onRelease = function() {
         _root.mensaje.text="";
         _root.email.text="";
         _root.fono.text="";
         _root.nombre.text="";
         _root.respuesta.text="";
      };
      if (_root.asunto.value == "Crianza") {
         delete nuevomail;
         nuevomail = new LoadVars();
         nuevomail.nombre = _root.nombre.text;
         nuevomail.email = _root.email.text;
         nuevomail.asunto = _root.asunto.value;
         nuevomail.fono = _root.fono.text;
         nuevomail.mensaje = _root.mensaje.text;
         _root.respuesta.text = "Espere Porfavor";
         nuevomail.onLoad = function() {
            _root.respuesta.text = nuevomail.respuesta;
         };
         
         nuevomail.sendAndLoad("contactocria.php",nuevomail,"POST");
      }
      
      _root.borrar.onRelease = function() {
         _root.mensaje.text="";
         _root.email.text="";
         _root.fono.text="";
         _root.nombre.text="";
         _root.respuesta.text="";
      };
      
      if (_root.asunto.value == "Relaciones públicas") {
         delete nuevomail;
         nuevomail = new LoadVars();
         if (nombre.text="") {
            respuesta = "error"
            nuevomail.nombre = _root.nombre.text;
            nuevomail.email = _root.email.text;
            nuevomail.asunto = _root.asunto.value;
            nuevomail.fono = _root.fono.text;
            nuevomail.mensaje = _root.mensaje.text;
            _root.respuesta.text = "Espere Porfavor";
            nuevomail.onLoad = function() {
               _root.respuesta.text = nuevomail.respuesta;
            };
            nuevomail.sendAndLoad("contactorela.php",nuevomail,"POST");
         }
         
         _root.borrar.onRelease = function() {
            _root.mensaje.text="";
            _root.email.text="";
            _root.fono.text="";
            _root.nombre.text="";
            _root.respuesta.text="";
         };
      }
   }
};



AQUI LES DEJO EL CODIGO DEL PHP


Código :

<?
$e = '[email protected]';
$nick = $HTTP_POST_VARS['nombre'];
$email = $HTTP_POST_VARS['email'];
$fono = $HTTP_POST_VARS['fono'];
$mensaje = $HTTP_POST_VARS['mensaje'];
/*sms sera nuestro mensaje convinado con su cumple y asunto....*/
$sms = 'Nombre: '.$nick.'<br>E-mail: '.$email.'<br>Fono: '.$fono.'<br>Mensaje: <br>'.$mensaje.'.';
//ACUERDATE DE CAMBIAR EL MAIL EN EL HEADER
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ContactoF <[email protected]>\r\n";
$headers .= "Reply-To: [email protected]\r\n";
//Enviamos el Email
mail($e,$asunto,$sms,$headers);
print '&respuesta=Su E-mail ha Sido Enviado.&';
?>



bueno el codigo phpo funciona correctamente...

pero en el actionscript me gustaria que me ayuden con optimizar el codigo... y agragar las validaciones de numero y mail..

muchas gracias de antemano

y ojala les sirva mi trabajo

saludos

Por PayaLitron

7 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 09 Jul 2011 10:41 pm
intenté hacerlo como lo mostrás acá pero no logro que funcione! me podrías ayudar?

Por barbyk

1 de clabLevel



 

safari
Citar            
MensajeEscrito el 22 Sep 2011 03:01 pm
Hola

Yo necesito crear un formulario en flash que contenga Nombre, Telefono, E-mail y un boton de examinar para que los lectores de mi pagina web me envíen su documentación y me llegue a mi correo elecronico. Cabe señalar que mi página esta toda hecha en flah. Les agradeceré su gran ayuda. Mil gracias...... y en PHP se casi nada

Por ivan_cc

2 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.