View Full Version : Flash to PHP works for me!

07-31-2007, 10:11 AM
I've got a flash to php form on my site that works 100% of the time... for me. Unfortunately, I keep receiving undefined emails through it. Since it works for me I don't know why it wouldn't work for someone else. Please can someone help?

The code in the flash file is this:

send_mc.onRelease = function()

loadVariablesNum ("form_send.php?sName=" + sName + "&sContact=" + sContact + "&sComments=" + sComments , 0, "POST");


In the php file it's this:



$to .= "me@mywebsite.com";
$subject .= "My website contact form";

//Main body

$msg .= "Name: $sName\n\n";
$msg .= "E-mail address: $sContact\n\n";
$msg .= "Comments/message: $sComments\n\n";

mail($to, $subject, $msg, "From: USER@mywebsite.com\nReply-To: $sContact\n");

I'm totally stuck and obviously can't test it, because it works!!!

07-31-2007, 12:15 PM
Can you attach your files including the .fla file so we can test it?

07-31-2007, 12:49 PM
Are you validating the input in flash before you send it ? you could be sending empty strings, you are also not doing any validation at the PHP end so you send mail regardless of whether any data is sent or not.. thats not entirely bad more of a waste of resources but more importantly your form can be used to send SPAM since you do no validation of emails etc .. see
this thread (http://www.codingforums.com/showthread.php?t=120080) for more info

07-31-2007, 02:04 PM
Ok, I wasn't doing any validation until this morning but now it won't allow you to send it if all the fields are blank! :-)

Here's a copy of the FLA:

I've stripped everything else out to get the filesize down so there's probably some stuff that doesn't work, but I've tested the form and it works for me!

The standalone form is here:

The php page is here:

If that doesn't work, here's a text file of it:

Many thanks!

07-31-2007, 02:06 PM
What is in form_send.php now?

07-31-2007, 02:17 PM
What do you mean "What is in it?" This link shows you what's in it:

07-31-2007, 02:24 PM
Thats what I meant. We can't magically see what is inside of php files. In the flash file you have

if (name_txt.text == "" && contact_txt.text == "" && comments_txt.text == "")
form_sent_mc.text_txt.text = "You cannot submit a blank form";
form_sent_mc._visible = true;
form_sent_mc.enabled = true;

You should probably using || (or) instead of &&. If the user just fills in one thing they can get past the if statement.

07-31-2007, 03:01 PM
That's what I wanted... It's just something to stop blank forms.