form mail flash php

acweb-2004

Utente Attivo
7 Giu 2006
133
0
16
Monza
www.acweb-2004.it
Da un filmato flash devo gestire un form per inviare mails, tramite uno script php.
in flash sul pulsante di invio ho questo codice:
function convalida () {
var sendMail:LoadVars = new LoadVars();
sendMail.nome = txt1;
sendMail.email = txt2;
sendMail.richiesta = txt6;
sendMail.phone = txt3;
sendMail.fax = txt4;
sendMail.adress = txt5;
sendMail.destinatario = 'acweb_2004@virgilio.it';
sendMail.onLoad = function(success){
if(success){
txt1 = label_01;
txt2 = label_02;
txt3 = label_03;
txt4 = label_04;
txt5 = label_05;
txt6 = label_06;
}
}
sendMail.sendAndLoad('email.php', sendMail, 'POST');
if (this.ris == "1")
{txt7 = "invio ok"}
else
{txt7 = "invio ko"}
}
In php ho questo codice:
<?php
$nome = $_POST['nome'];
$email = $_POST['email'];
$richiesta = $_POST['richiesta'];
$phone = $_POST['phone'];
$fax = $_POST['fax'];
$adress = $_POST['adress'];
$destinatario = $_POST['destinatario'];
$oggetto = "mio oggetto";
$sms = '........................';
$headers = "From: $nome <$email>\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";

if(mail($destinatario, $oggetto, $sms, $headers)){
echo "ris=1";
}
else
{
echo "ris=2";
}
?>
Le mails vengono correttamente inviate, ma il ritorno di "ris" da php a flash non è corretto, la variabile txt7 è sempre valorizzata con "invio ko". Chi mi sa indicare l'errore???
ciao
augusto
 
Da un filmato flash devo gestire un form per inviare mails, tramite uno script php.
in flash sul pulsante di invio ho questo codice:
function convalida () {
var sendMail:LoadVars = new LoadVars();
sendMail.nome = txt1;
sendMail.email = txt2;
sendMail.richiesta = txt6;
sendMail.phone = txt3;
sendMail.fax = txt4;
sendMail.adress = txt5;
sendMail.destinatario = 'acweb_2004@virgilio.it';
sendMail.onLoad = function(success){
if(success){
txt1 = label_01;
txt2 = label_02;
txt3 = label_03;
txt4 = label_04;
txt5 = label_05;
txt6 = label_06;
}
}
sendMail.sendAndLoad('email.php', sendMail, 'POST');
if (this.ris == "1")
{txt7 = "invio ok"}
else
{txt7 = "invio ko"}
}
In php ho questo codice:
<?php
$nome = $_POST['nome'];
$email = $_POST['email'];
$richiesta = $_POST['richiesta'];
$phone = $_POST['phone'];
$fax = $_POST['fax'];
$adress = $_POST['adress'];
$destinatario = $_POST['destinatario'];
$oggetto = "mio oggetto";
$sms = '........................';
$headers = "From: $nome <$email>\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";

if(mail($destinatario, $oggetto, $sms, $headers)){
echo "ris=1";
}
else
{
echo "ris=2";
}
?>
Le mails vengono correttamente inviate, ma il ritorno di "ris" da php a flash non è corretto, la variabile txt7 è sempre valorizzata con "invio ko". Chi mi sa indicare l'errore???
ciao
augusto


non vorrei dire una cavolata ma perche' hai messo due simboli = in questa stringa di codice

sendMail.sendAndLoad('email.php', sendMail, 'POST');
if (this.ris == "1")

ciao!!
 

Discussioni simili