Hey there,
i need to built a kiosk application where users can enter their email and name. This information should be emailed. So i have set up a as2 file with 2 input text fields, bot with variables. "name" and "email". Instance name "name_txt" and "email_txt".
This is my code in flash
ActionScript Code:
var email = email_txt.text;
var name = name_txt.text;
var my_lv:LoadVars = new LoadVars();
send_btn.onRelease = function(){
my_lv.email = email_txt.text;
my_lv.name = name_txt.text;
my_lv.send("email.php", "_blank", "POST");
}
and this is my php code
PHP Code:
<?php
$sendTo = "[email protected]";
$subject = "ContactForm";
$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["email"];
$message = $_POST["message"];
mail($sendTo, $subject, $message, $headers);
?>
i do get the mails, but they appear as "undefined"
maybe you cxan help me out by pointing me in the right direction. Must be a stupid mistake i make there. Thanks for helping me out!