Creating eMail form using components.
Hello,
i need some help with creating this email form in flash for my website. i have found some various tutorials and methods but none seem to work. Obviously i'm doing something wrong since it appears to work in the video tutorials.
So here is my issue....
I'm using AS3. My code is pasted below. Whith this code when I publish to view my website, at first it all seems ok. I can go through all the pages fine. the problem comes when i go to the CONTACT form page. first time i enter the page, it looks fine...than when i go to another page and come back to the contact page the form dissappears.
my form is placed on frame 11 of my main timeline, inside a movie clip named contact.
----------------------------------------------------
import fl.controls.Button
import fl.controls.TextArea
import fl.controls.TextInput
//hide processingMC
processingMC.visible=false;
sendBTN.addEventListener(MouseEvent.CLICK, sendMessage);
function sendMessage(e:MouseEvent):void{
var my_vars:URLVariables = new URLVariables();
my_vars.senderName = firstName.text;
my_vars.senderNamelast = lastName.text;
my_vars.senderPhone = phone.text;
my_vars.senderEmail = eMail.text;
my_vars.senderMsg = msg.text;
var my_url:URLRequest = new URLRequest("my_form.php");
my_url.method = URLRequestMethod.POST;
my_url.data = my_vars;
var my_loader:URLLoader = new URLLoader();
my_loader.dataFormat = URLLoaderDataFormat.VARIABLES;
my_loader.load(my_url);
firstName.text = "";
lastName.text = "";
phone.text = "";
subject.text = "";
eMail.text = "";
msg.text = "Message Sent";
}
---------------------------
my_form.php file looks like this....
<?php
$to = "vish92683@yahoo.com";
$subject = ($_POST['senderName','senderNamelast]);
$message = ($_POST['senderMsg']);
$message .= "\n\n---------------------------\n";
$message .= "E-mail Sent From: " . $_POST['senderName'] . " <" . $_POST['senderEmail'] . ">\n";
$headers = "From: " . $_POST['senderName'] . " <" . $_POST['senderEmail'] . ">\n";
if(@mail($to, $subject, $message, $headers))
{
echo "answer=ok";
}
else
{
echo "answer=error";
}
?>
----------------------------
what am i missing?
