Diablo-IT
20-08-2008, 13:24
Ciao a tutti.
In un sito flash 8, actionscipt 2.0, ho bisogno di inserire un form per l'invio di email.
Ho creato 3 "input textbox", (chiamati name, email, comments), un "button" dove inserire il codice per l'invio, ed un "dynamic textbox" dove visualizzare un messaggio di avvenuto invio.
In seguito ho creato un file con codice php per l'invio dell'email.
Problema... non funziona!
Ovvero l'email arriva, ma senza le variabili che da flash passo al php (ovvero testo del messaggio ecc).
Sto leggendo vari tutorials in rete ma senza trovar soluzione, qualcuno di voi sa aiutarmi? Grazie.
Codice actionscript:
on (release) {
// logical operator makes sure the textfield is not blank. IndexOf checks for "@" and "." characters in textfield
if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
results = "Please check your e-mail address.";
} else if (!comments.length) {
results = "Please enter your comments.";
} else if (!name.length) {
results = "Please enter your name.";
} else {
loadVariablesNum ("http://wwwxxxxxxxxxxit/mailform.php", 0, "GET");
results = "Sending Data...";
}
}
Codice PHP:
<?php
$TextVariable = '&results=';
$response = 'Data Sent. Thank You..';
echo $TextVariable;
echo $response;
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
/* recipients */
$recipient .= "xxxx@xxxxxxxxxxx.it" ;
/* subject */
$subject = "Your Automail";
/* message */
$message .= "Name: $name
Email: $email
Comments: $comments";
/* additional header pieces for errors, From cc's, bcc's, etc */
$headers .= "From: $name <$email>n";
/* and now mail it */
mail($recipient, $subject, $message, $headers);
?>
In un sito flash 8, actionscipt 2.0, ho bisogno di inserire un form per l'invio di email.
Ho creato 3 "input textbox", (chiamati name, email, comments), un "button" dove inserire il codice per l'invio, ed un "dynamic textbox" dove visualizzare un messaggio di avvenuto invio.
In seguito ho creato un file con codice php per l'invio dell'email.
Problema... non funziona!
Ovvero l'email arriva, ma senza le variabili che da flash passo al php (ovvero testo del messaggio ecc).
Sto leggendo vari tutorials in rete ma senza trovar soluzione, qualcuno di voi sa aiutarmi? Grazie.
Codice actionscript:
on (release) {
// logical operator makes sure the textfield is not blank. IndexOf checks for "@" and "." characters in textfield
if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
results = "Please check your e-mail address.";
} else if (!comments.length) {
results = "Please enter your comments.";
} else if (!name.length) {
results = "Please enter your name.";
} else {
loadVariablesNum ("http://wwwxxxxxxxxxxit/mailform.php", 0, "GET");
results = "Sending Data...";
}
}
Codice PHP:
<?php
$TextVariable = '&results=';
$response = 'Data Sent. Thank You..';
echo $TextVariable;
echo $response;
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
/* recipients */
$recipient .= "xxxx@xxxxxxxxxxx.it" ;
/* subject */
$subject = "Your Automail";
/* message */
$message .= "Name: $name
Email: $email
Comments: $comments";
/* additional header pieces for errors, From cc's, bcc's, etc */
$headers .= "From: $name <$email>n";
/* and now mail it */
mail($recipient, $subject, $message, $headers);
?>