From: kcardinali on
I am wondering if I can create a flash form that will send to an email address,
name, email and comments, without leaving flash. Right now I have it set up
calling an asp page which than sends the form BUT than I have to redirect and
this web site was built as one file, so I can redirect back to the homepage,
but I want it to redirect back to where the user sent the file in that flash
file. Please help me, I am not happy with how it is set up now cause it is
not user friendly.

THANKS! any help would be great.

From: Adr_Laik on
You can try Flash + Php solutiuon .
In the flash define two text input components , a text area component , give
them instance name like name_txt , myEmail_txt , comments_txt and then you
must use some actionscript :

my_lv = new LoadVars();
send_btn.onRelease = function()
{
trace(nume_txt.text);
my_lv.name = name_txt.text;
my_lv.myEmail = myEmail_txt.text;
my_lv.comment = comments_txt.text;
my_lv.sendAndLoad("mail.php", result_lv, "POST");
}
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean)
{
if (success)
{
trace("success");
// inform user for a succes data sending
} else
{
trace("failure");
// inform user for an error during data sending
}
}

Then in the same location as your .swf / .exe file create a new mail.php file
and attach this code :
<?php
$name=$_POST;
$comment = $_POST;
$myEmail=$_POST;
$mailTo='someaddress(a)someserver.com';
$title = "New Comment posted by"+$name;
$comment2Send = $myEmail + ":"+$comment;
mail($mailTo,$title,$comment2Send,$myEmail);
?>

Notice that you can format your data anyway you want to appear right in the
new mail.


From: kcardinali on
Using the php, will it leave the flash file to read the php file?
From: WeQCcom on
Originally posted by: Adr_Laik
You can try Flash + Php solutiuon .
In the flash define two text input components , a text area component , give
them instance name like name_txt , myEmail_txt , comments_txt and then you
must use some actionscript :

my_lv = new LoadVars();
send_btn.onRelease = function()
{
trace(nume_txt.text);
my_lv.name = name_txt.text;
my_lv.myEmail = myEmail_txt.text;
my_lv.comment = comments_txt.text;
my_lv.sendAndLoad("mail.php", result_lv, "POST");
}
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean)
{
if (success)
{
trace("success");
// inform user for a succes data sending
} else
{
trace("failure");
// inform user for an error during data sending
}
}

Then in the same location as your .swf / .exe file create a new mail.php file
and attach this code :
<?php
$name=$_POST;
$comment = $_POST;
$myEmail=$_POST;
$mailTo='someaddress(a)someserver.com';
$title = "New Comment posted by"+$name;
$comment2Send = $myEmail + ":"+$comment;
mail($mailTo,$title,$comment2Send,$myEmail);
?>

Notice that you can format your data anyway you want to appear right in the
new mail.


Hey guys! I dont have an answer for kcardinali, but I too am stuck on the same
problem! I have tried many different "versions of the PHP/Actionscript method
to receive replys from an online contact form with no success. I have done
exactly as Adr_Laik
suggested but am not having any luck getting it to work. I can log on to the
server hosting my site and open the PHP file and it DOES generate and send an
empty message with the subject of 0. This makes me think the PHP end is ok, it
is just not receiving the variables from the flash page. The only thing that
happens when the button is clicked is the blinking cursor in the text field
disappears, no confirmation or error message or anything. I have created two
text input components , a text area component , and given them instance name
like name_txt , myEmail_txt , comments_txt. Any more suggestions??