PDA

View Full Version : Forms stopped working when upgraded to Fv8


jdmabry
11-29-2005, 04:44 AM
Hello,

I have been searching for days on a fix for this simple problem. When I switched to Flash 8 I redesigned my site and have lost the functionality of my contact form. I know you guys get this question all the time - I've read all the post and applied the answers but to no avail. I keep getting blank emails from my form.

I was using simple php:

<?php
$to = "[email protected]";
$msg .= "$name\n\n";
$msg .= "$phone\n\n";
$msg .= "$attendants\n\n";
$msg .= "$date\n\n";
$msg .= "$location\n\n";
$msg .= "$time\n\n";
$msg .= "$message\n\n";
mail ($to, $subject, $msg, "From: My Booking Request Form\nReply-To: $email\n");
?>

And my AS was just as simple:

on (release) {
if (name eq "" or phone eq "" or email eq "" or attendants eq "" or date eq "" or location eq "" or time eq "" or message eq ""){
stop ();
}else{
loadVariablesNum ("bookingform.php", 0, "POST");
loadMovieNum("ty.swf", 1, "GET");
}
}

This has worked for years until the upgrade. My host is the same.

If you could take the time to look for a problem please let me know.

You can see the site in action at http://www.jdmabry.com it's under "booking".

Thanks in advance for anyone willing to help. I'm at my wits end with what I know was simple. I'm just not a coder.

Flash Gordon
11-29-2005, 05:03 AM
if (name == "" || phone == "" || ){try that.

jdmabry
11-29-2005, 05:24 AM
I replaced everything as sugested and it still sent me a blank email.

Flash Gordon
11-29-2005, 05:36 AM
this is why you should format your code...

<?php
$to = "[email protected]";
$msg .= "$_POST['name']\n\n";
// ect..
mail ($to, $subject, $msg, "From: My Booking Request Form\nReply-To: $email\n");
?>

jdmabry
11-29-2005, 04:17 PM
I recoded the php as suggested - it doesnt send an email at all now.

I browsed to the file "bookingform.php" on my server and it gave me this error:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/advance/public_html/jdmabry.com/bookingform.php on line 3

What does this mean?

Here is my code now:

<?php
$to = "[email protected]";
$msg .= "$_POST['name']\n\n";
$msg .= "$_POST['phone']\n\n";
$msg .= "$_POST['attendants']\n\n";
$msg .= "$_POST['date']\n\n";
$msg .= "$_POST['location']\n\n";
$msg .= "$_POST['time']\n\n";
$msg .= "$_POST['message']\n\n";
$msg .= "$_POST['email']\n\n";
mail ($to, $subject, $msg, "From: My Booking Request Form\nReply-To: $email\n");
?>

Flash Gordon
11-29-2005, 05:57 PM
my mistake
$msg .= $_POST['name'] . "\r\n";

jdmabry
11-29-2005, 06:39 PM
I adjusted it again to your specs - mail takes very long time to deliver and then is still blank.

I have included my .fla and .php files if you want to test.

I know that the AS doesnt do exactly what it's supposed

ie: ty.swf pops up no matter what (i dont know how to get it to check if the email has actually been sent)

but if you could get the form just working that would be awesome.

thanks for all the help so far FG!!


http://www.jdmabry.com/download/JdMabry.zip

Flash Gordon
11-29-2005, 06:43 PM
i don't have flash 8. It would be a lot easier to help if you included all the scripts necessary for your function FOMATED

jdmabry
11-29-2005, 06:58 PM
i'm not sure what you mean. You need the text for the php formatted?

Flash Gordon
11-29-2005, 07:39 PM
i suggest this:

on (release) {
if (name == "" || phone == "" ){
stop ();
}else{
var LV:LoadVars = new LoadVars();
LV.name = name_txt.text
LV.email = email_txt.text
LV.sendAndLoad ("bookingform.php", "_self", "POST");
loadMovieNum("ty.swf", 1, "GET");
}
}

<?php
$to = "[email protected]";
$msg .= $_POST['name'] . "\n\n";
$msg .= $_POST['phone'] . "\n\n";

mail ($to, $subject, $msg, "From: My Booking Request Form\nReply-To: $email\n");
?>

Else, do a little research there are plenty of tutorials here.

jdmabry
11-29-2005, 08:02 PM
I changed lines 3 & 4 as you can see in the pic below and now i get an email but just has the text in the php form. Check out the pics below.

http://www.actionscript.org/forums/attachment.php3?attachmentid=15381&stc=1&d=1133298103

http://www.actionscript.org/forums/attachment.php3?attachmentid=15380&stc=1&d=1133298103

jdmabry
11-29-2005, 11:08 PM
I have gotten the email to display the fields but says "undefined" where the variables should be. ie: Name: undefined

I feel like i'm getting close but cant get there.