...

View Full Version : Flash to PHP works for me!



Albinal
07-31-2007, 09: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:

<?

$sName=$_GET["sName"];
$sContact=$_GET["sContact"];
$sComments=$_GET["sComments"];

$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!!!

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

firepages
07-31-2007, 11:49 AM
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

Albinal
07-31-2007, 01: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:
http://www.albinal.com/flashForm.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:
http://www.albinal.com/flashForm.swf

The php page is here:
http://www.albinal.com/form_send.php

If that doesn't work, here's a text file of it:
http://www.albinal.com/form_send.txt

Many thanks!

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

Albinal
07-31-2007, 01:17 PM
What do you mean "What is in it?" This link shows you what's in it:
http://www.albinal.com/form_send.txt

_Aerospace_Eng_
07-31-2007, 01: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.

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum