hi there,
I am trying so create an email function in flash… and my php is as follows …
For starters - Is this php correct!? The flash file is sendAndLoad 'ing the variables ‘name_txt’ etc…
<?php
$to = "jeancnicolas@yahoo.co.uk";
$subject = “Message From Website”;
$name_txt = $_POST[‘name_txt’];
$email_txt = $_POST[‘email_txt’];
$message_txt = $_POST[‘message_txt’];
$body = “From: $name_txt
E-Mail: $email_txt
Message:
$message_txt”;
echo “confirmation=true”;
mail($to, $subject, $body);
?>
and my AS for my flash send button is:
send_btn.onRelease = function (){
var sender:LoadVars = new LoadVars();
sender.name_txt = name_txt.text;
sender.email_txt = email_txt.text;
sender.message_txt = message_txt.text;
var receiver:LoadVars = new LoadVars();
sender.sendAndLoad("email.php",receiver);
trace (sender);
receiver.onLoad = function(success:Boolean){
if(!success){
error_txt.text = "Connection Failed";
return;
}
if( receiver.confirmation == "true" ){
error_txt.text = "Thank You";
}
else {
error_txt.text = "Sorry The Message Failed To Send"
}
}
}
Can anyone seey where I am going wrong!?
As it doesn’t work!
(P.s. My server does support PHP!)
THANKYOU!!!