Código ActionScript :
stop();
// --------------------------------------------------------------
// función que valida números
// --------------------------------------------------------------
String.prototype.isNumbers = function() {
if (this.length<1) {
return false;
}
for (i=0; i<this.length; i++) {
code = this.charCodeAt(i);
if (this.charAt(i) != " " && code<48 || code>57) {
return false;
}
}
return true;
};
// --------------------------------------------------------------
// valida mails
// --------------------------------------------------------------
String.prototype.isMail = function() {
if (this.indexOf("@")>0 && this.indexOf("@") == this.lastIndexOf("@")) {
if (this.lastIndexOf(".")>this.indexOf("@")+1 && this.lastIndexOf(".")<this.length-2) {
return true;
}
}
};
// --------------------------------------------------------------
// función que limpia los campos
// --------------------------------------------------------------
function limpiar() {
nom = "";
telefono = "";
mailFrom = "";
body = "";
mail_txt = "";
mensaje_error = "";
}
// --
nombre.tabIndex = 1;
tel.tabIndex = 2;
mail.tabIndex = 3;
msg.tabIndex = 4;
// --
bEnviar.onRollOver = bLimpiar.onRollOver=function () {
this.gotoAndPlay("sobre");
};
bEnviar.onRelease = function() {
if (nom.length<1) {
mensaje_error = "Por favor introduzca su nombre";
} else if (telefono.length<7 or telefono.isNumbers() == false) {
mensaje_error = "Por favor, introduzca un teléfono de contacto";
} else if (!mail.text.isMail()) {
mensaje_error = "Por favor, introduzca e-mail válido";
} else {
var ibsvar:LoadVars = new LoadVars();
ibsvar.nom = nom;
ibsvar.telefono =telefono;
ibsvar.mailfrom = mailfrom;
ibsvar.body = body;
ibsvar.send( "form.php","","POST");
mensaje_error = "Mensaje enviado con exito";
limpiar();
}
};
// --
bLimpiar.onRelease = function() {
limpiar();
};
Yo creo que el problema es del .fla pero no sé en donde, sin embargo les escribo la línea de código del php:
<?
$name=$_REQUEST['nom'];
$phone=$_REQUEST['telefono'];
$to = $_REQUEST['mailfrom'];
$body = $_REQUEST['body'];
$msg = "Nombre: $name \r";
$msg .= "Teléfono: $phone \r";
$msg .= "E-mail: $to \r\r\r ";
$msg .= "Comentarios : $body";
mail('[email protected]', 'Contacto', $msg, "From: $to");
$msg='<html> <head> <title> $titulo </title> </head>
<body>
<p>Gracias por elegirnos. <strong><font color="#FF9933" size="2" >aqui va el nombre</font></strong></p>
</body> </html>';
$headers = "from: [email protected] \r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail($to, 'confirmación de la empresa', $msg,$headers );
?>
Mil y mil gracias por su ayuda.
