How to make a Flash Contact form Work
Posted on 13. Mar, 2007 by Dave in ActionScript
If you liked this post, please subscribe! You’ll be glad you did!
foamers.net will install this script for you for as little as $80 a pop. Should you wish to employ our design team to make your Flash contact form work hop on over to the contact page and talk to us..
If you have been searching around trying to figure out what is the easiest way to make a Flash contact form work, then this is it. In this tutorial you will learn how to create a Flash contact form. PHP is provided. Very simple..
First of all, please see How to make a contact form work demo movie.
Then you should DOWNLOAD the following php script, save it as contact.php:
[code lang="php"]
< ?php
$your_company = $_GET['company'];
$your_name = $_GET['your_name'];
$your_phone = $_GET['phone'];
$your_email = $_GET['email'];
$your_message = $_GET['message'];
// change this to whatever you needed to be.
$recipient = 'you@yourdomain.com';
//you can make it say anything you want
$subject = 'Someone has submited your form';
// Do not edit anything else beyond this point
$headers .= 'Content-type: text/html; charset=iso-8859-1';
$content = "
";
$content .= "Company: " . $your_company . "
";
$content .= "Name: " . $your_name . "
";
$content .= "Phone: " . $your_phone . "
";
$content .= "E-mail: " . $your_email . "
";
$content .= $your_message;
$content .= "
";
// The mail() function allows you to send mail.
mail($recipient,$subject,$content,$headers);
?>
Your message was sent. Thank you.
[/code]
Put your e-mail address as shown in a video tutorial and then save this file. Place this contact.php file in the same folder where you have your SWF movie. That’s all!
83 Responses to “How to make a Flash Contact form Work”
Leave a Reply
You must be logged in to post a comment.




iMatt
yaelnowo on
dave on 




Collado
29. Jun, 2008
thank you! glad you like it… you can totally change the “from” simply…
Find this like
// change this to whatever you needed to be.
$recipient = ‘you@yourdomain.com’;
Add this beneath it
$from address = ‘From: you@yourwebsite.com‘;
Find this line
// The mail() function allows you to send mail.
mail($recipient,$subject,$content,$headers);
Change it to say
// The mail() function allows you to send mail.
mail($recipient,$subject,$content,$fromaddress);
Now save your changes and upload the file and try it again.
Mike
21. Jul, 2008
Hey man thank you for being an amateur Philanthropist…. :)
Can you please tell me a link where I can make your tutorial more functional and powerful like adding an Anti-spam field and prohibiting the sender to click the submit button many times!
verdi
29. Jul, 2008
HELP!!!!
I made the contact form and was working perfectly fine until we launched the website. Now contact form is not working. I didn’t change a thing so I am not sure what’s wrong.
Collado
30. Jul, 2008
whats actually happening when your submitting? can you give us a link to the site, send me your FLA ( sales@foamers.net )file and email me your FTP info
Matthew
01. Aug, 2008
When I hit the submit button I get the “message sent screen” but I am getting no emails. Please help before I pull the rest of my hair out!
Collado
02. Aug, 2008
Matt, I can install this script for you for as little as $80 a pop. So if you really want to make your Flash contact form work right now hop on over to the contact page and talk to me
Kris
12. Aug, 2008
Thanks a lot. Your script is working, I’have lost some days trying but with your example in 5 minuts I finished. Thanks again.
Collado
12. Aug, 2008
thank you Kris… I checked out the site, great job! the only thing I would try to change is the font size and clarity… check out my other post on Stylesheets, Flash and XML for Dummies… that might be helpful. Also don’t forget to subscribe to my feed and stay up to date on all our latest stuff…
michael
14. Aug, 2008
hi, this form it works for php5? and do me a favor, can u send me the form.php thnx u
michael
14. Aug, 2008
or u can post a zip, including the mail.php and a form fla. pls
Collado
14. Aug, 2008
You can find the php script right above along with everyone else, as for the fla file, what fla file? each individual website would have its own individual fla file… the whole purpose of being here is you have a fla file and you wish to make the contact form work.. the script will works on any flash form
michael
15. Aug, 2008
Collado Help me. please why not work :( helpe me man. thx
Collado
15. Aug, 2008
first of all see the “how to make a flash contact form work demo movie” to get the submit button working properly…. then also take a look at your contact.php your using all sorts of uppercase variable names as in $_GET['Nombre'] you might want to see if your flash also has that in uppercase etc. Also we removed the code you posted on the previews comment… PLEASE do not post your code unless we have actually requested that you do. thank! And as always should you wish to acquire more information about my own Flash customization services simply jump over to the contact form and let me know what you’re thinking.
Matts
15. Aug, 2008
Hi Collado,
I see that many people are having the same problem as mine.
The contact form will only work in Explorer… not Firefox or Avant.
Also, everything that I type in is not there when I receive the email.
Matts
15. Aug, 2008
Ok I found my bug and for all those who had the same problem, dont use the button from the Component library in Flash. You will have to make a custom one.
Everything will work even in different browsers.
joe
18. Aug, 2008
Hi,
I used your contact form and php script and am having a little problem.
I do receive an email with the correct subject, but the fields i filled in on the fla aren’t included in the mail. it looks like:
name:
phone:
email:
I don’t think a message field came in either.
I’ve checked the variables in the flash file, they seem to be correct.
on (release) {
_parent.getURL(“contact.php”, “_blank”, “GET”);
_parent.company = “Your Company”;
_parent.name = “Your Name:”;
_parent.phone = “Your Phone:”;
_parent.email = “Your Email:”;
_parent.message = “Your Message”;
}
I see others had this issue but I did not see a resolution any ideas?
Thanks
Collado
18. Aug, 2008
try it without the _parent.company but rather with just company
let me know if fixes it
joe
18. Aug, 2008
Hi Collado,
The code didnt come up with errors and it still sent but the contents did not arrive in the mail
Company:
Name:
Phone:
E-mail:
——————————————————————————–
I change the code to
on (release) {_parent.getURL(“contact.php”,”_blank”,”GET”);
company = “Your Company”;
name = “Your Name:”;
phone = “Your Phone:”;
email = “Your Email:”;
message = “Your Message”;
}
Thanks
Collado
18. Aug, 2008
git rid of _parent in the getURL also that should do it
joe
18. Aug, 2008
Hi Collado,
The code didnt come up with errors and it still sent but the contents Still did not arrive in the mail
Company:
Name:
Phone:
E-mail:
——————————————————————————–
I changed the code to
on (release) {getURL(“contact.php”,”_blank”,”GET”);
company = “Your Company”;
name = “Your Name:”;
phone = “Your Phone:”;
email = “Your Email:”;
message = “Your Message”;
}
Thanks for trying to help me with this.
Any thing else you can suggest?
Matts
28. Aug, 2008
To Joe and Collado:
The problem that Joe is having was similar to mine.
The button you creat in Flash cant be from the component library.
Make a custom button and everything will work!
joe
29. Aug, 2008
Matts
Thanks, I will Try that.
joe
29. Aug, 2008
Matts,
I made my own button in flash, but that didn’t seem to work either.
Same Issue.
ly
11. Sep, 2008
THANKS SOOOOOO MUCH FOR THIS TUTORIAL!!!!!!
Jeff
11. Sep, 2008
I’ve been working this for about 8 hrs now…LOL
I took out a few lines I didn’t need as far as contact info. I’m getting similiar results as few above but with **’s
In my email I get:
Name: **
Phone: **
E-mail: **
Any Ideas?
Thanks!!!
darren
20. Sep, 2008
Hello I am uploaded the contact page to my site but when I go ahead and hit submit i get this error in a new window
Parse error: syntax error, unexpected ‘@’ in /home/content/s/t/a/mydomain/html/magicx/test4/contact.php on line 10
I entered my email correct but it says this error
Natalie
07. Oct, 2008
Love this tutorial… can you help…. here’s my error
Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /home/allinwhi/public_html/winknsmile/contact.php on line 2
Parse error: syntax error, unexpected T_STRING in /home/allinwhi/public_html/winknsmile/contact.php on line 2
Collado
07. Oct, 2008
Hi Natalie,
Messages like syntax error, unexpected T_IF, syntax error, unexpected T_STATIC, and so on are admittedly quite cryptic. It means that the PHP interpreter found an a reserved word someplace that it didn’t expect it. (Which word? whatever comes after the underscore. So if the message is syntax error, unexpected T_STRING, look for some text like $myvariable = “mytext”.)
Frequently, this means that the previous program element (assignment statement, if statement, echo, whatever) wasn’t finished/closed correctly. So you’ll wan’t to look for a missing “;” at or above line 2 of contact.php.
Missing Semicolon Example
WRONG
2
3
4
5
if($bar == $baz)
{
// do something...
}
RIGHT
2
3
4
5
if($bar == $baz)
{
// do something...
}
good luck!
Willem
20. Oct, 2008
Same problem as everyone else, sends the email perfect but no content!
Only subject headers.
If something else needs to be changed please add it to the tutorial.
Vinny
27. Oct, 2008
Looks like a greate tutorial but like many others i cannot get it to work. E-mail is sent but no content. I check all the names and spelling. Any suggestions?
Rob
20. Nov, 2008
Thanks Collado,
at first I was not getting any input in the email
Name:
Email:
——————
Message:
but then I tried your fix- removing the _parent as stated above
works now! Just in case you thought it was bad advice-
Asif
28. Dec, 2008
Hi Collado,
This is a brilliant script and so easy to set up. I got mine working first time.
I have 2 quick question. When the form is emailed back to me, the conents appear in a light green color. I want it to show in black so it is easier to read.
I played around with the tag but could not get it to work.
Also, I tried your suggestion above about adding some lines to chnage the “from” address, but could not get that to work.
My email is coming from CGI-Mailer [cgi-mailer@kundenserver.de]
Many thanks for any help.
Collado
29. Dec, 2008
I would like to try to submit the form myself, is there a link you can show me? My guess is that within flash itself the form field text color property is green, thus you get the green, otherwise maybe under the body tag you can try looking for a font tag or style tag with a color attribute… good luck also don’t forget to subscribe to my feed and soon our newsletter, so you can stay up to date on this thread and other useful stuff