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...
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