Phpform not mailing in holderMC

Ok… I’m rather confused.

I have a feedback form in flash. With one textfield with the var “name” and another textfield with the var “email”, one with the var “body”, and finally one with the var “returnmessage”.

These all start in a frame named “first”.

On my submit button I have :


on (release) {
	loadVariables("sendform.php", this, "POST");
	gotoAndPlay("second");
	returnmessage = "Sending message in progress ...";
}

In the frame labeled “second”, I have :


if(is_sent == 1){
	gotoAndStop("first");
}

and on the third frame named “third” I have:


gotoAndPlay ("second");

In my sendform.php file, I have :


<?
$toadress = "myemail@myemail.com";
$subject = "Contact Form";
$mailcontent = "From: $name.


 Email: $email


 $body";

$headers .= "From: $name<$email>
";
mail($toadress, $subject, $mailcontent, $headers);
echo "returnmessage=The message is successfully sent.&is_sent=1";
?>

Ok… This all works PERFECT together, if i just call up the individual .swf that this is loaded into. Once I call this .swf into a placeholder MC in my main .swf, it doesn’t work anymore. I have tried and tried and … yes… tried some more to get it to work, and I just can’t figure it out. I am TERRIBLY disturbed by this, and want to know how to fix it.

Am I correct in assuming that it has something to do with the

loadVariables("sendform.php", this, "POST");

part of it?

I have no clue…

Pleeeeeeeeeeeease help!!!:crazy:

your problem may be on the following line of code:


echo "returnmessage=The message is successfully sent.&is_sent=1";

you may wonder why… well, the variables ‘returnmessage’ and ‘is_sent’ are stored in the main timeline of the .swf when you call loadVariables(); … your second .swf is not accesing the main timeline’s variables… at least i think so :slight_smile:

try using instead:


echo "_root:returnmessage=The message is successfully sent.&_root:is_sent=1";

and modify your .fla adding _root: to ‘returnmessage’ and ‘is_sent’ variables in your secondary .swf (that you load in your main .swf)

i’m not sure if this solves your problem, but it’s worth to try :slight_smile:

Thanks for the help, but i figured out what the problem was… by a fluke!

Because I had a main.swf that loaded other .swf’s into a holding clip, that were located in other directories, i was putting the .php file in those directories. DOH!

I somehow saw an error that it couldn’t find the php file in the directory of where my main.swf was located… put it in there… and my script worked perfect.

I am such a dork.

::laughing::

Thanks again!

lolz :slight_smile: