|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Sep 2007
Messaggi: 312
|
[FLASH + PHP4] Form invio mail
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: Codice:
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 $TextVariable = '&results='; $response = 'Data Sent. Thank You..'; echo $TextVariable; echo $response; $name = $_POST['name']; $email = $_POST['email']; $comments = $_POST['comments']; /* recipients */ $recipient .= "[email protected]" ; /* 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); ?> Ultima modifica di Diablo-IT : 20-08-2008 alle 14:48. |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 14:33.



















