12/03/2009, 15:02
|
| | Fecha de Ingreso: enero-2007 Ubicación: perdida entre líneas de código...
Mensajes: 235
Antigüedad: 17 años, 10 meses Puntos: 1 | |
Respuesta: como funciona un formulario en flash?? Hola Diegoazul, gracias por interesarte.
EL php es este: Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<title>:bnwagency.</title>
</head>
<body>
<?
$auth_domain = array("www.estudioblazar.com.ar");
$subject = "Forma de Contacto - www.bnwagency.com";
$mailTo = "[email protected], [email protected]";//email del destinatario
if (isset($HTTP_REFERER)) {
foreach ($auth_domain as $line) {
if (eregi($line,$HTTP_REFERER)) {
$check_url = 1;
continue;
}
}
}else{
$check_url = 1;
}
if ($check_url != 1) {
echo "error=this formmail is not allowed in your domain";
exit;
}
$date = getdate(time());
$date = sprintf("%s %s %s %s:%s:%s", $date["mday"],$date["month"],$date["year"],$date["hours"],$date["minutes"],$date["seconds"]);
$from = "$nam<$email> ";
$header = "From:$from\n";
$header .= "Reply-To:$from\n";
$body = "The following comment has been sent by: \n";
$body .= "$name el $date\n\n";
$body .= "---------------------------------------------------------------\n\n";
$body .= "$nam\n\n";
$body .= "$company\n\n";
$body .= "$address\n\n";
$body .= "$email\n\n";
$body .= "$phone\n\n";
$body .= "$subject\n\n";
$body .= "$comments\n\n";
$body .= "---------------------------------------------------------------\n\n";
$header=trim($header);
ini_set("sendmail_from", "[email protected]");
mail($mailTo, $subject, $body, $header, $date, $from) or die("error=Message could not be delivered!");
echo "error=Your message has been succesfully sent!";
?>
</body>
</html> Y el As: stop ();
if (cgilocation == undefined) {
// set the following cgilocation to the url of the formmail script (php or perl) on your server";
// cgilocationÀ» ¼*¹ö¿¡ ¼³Ä¡ÇÑ formmail scriptÀÇ url·Î º¯°æÇØ ÁÖ¼¼¿ä..";
cgilocation = "shformml.php";
}
nam=""
company=""
address=""
email=""
phone=""
subject=""
comments = "";
error = ""
on (release) {
// Clear the text fields.
nam = "";
company = "";
address = "";
email = "";
phone = "";
subject = "";
comments = "";
error = "";
}
on (release) {
// check if the email address includes "@" and "." after more than 1 characer.
function checkemail (email) {
var str = new String(email);
var arr_email = str.split("@");
if (arr_email.length != 2 || arr_email[1].indexOf(".")<1) {
showerror("Invalid E-mail");
return false;
} else {
return true;
}
}
function showerror(message){
gotoAndStop("error");
error = message;
}
if (nam != "" && nam != undefined && email != "" && email != undefined && comments != "") {
if (checkemail(email)){
loadVariables(cgilocation, "", "POST");
showerror("Sending..");
}
} else {
trace("empty");
showerror("Please fill out the required fields.");
}
}
El AS te lo puse medio mezclado porque está en diferentes frames, no se como copiarlo en orden, espero que te sirva, sino avisame cómo lo querés.
Gracias! |