FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Create a Flash Contact form, sends to your email account

 


Raidation
First of all, no, this is not the crappy mailto function. I hate it. I will NEVER tell you to use it.

1. Create an AS2 Flash File. I prefer AS2 over AS3 because it's easier to use.

2. Create your form with input text and labels and stuff. Leave out the submit button.

3. Give each input field a variable.

3. Turn the form into a symbol, a movieclip.

4. Give it an instance name of form.

5. Create a submit button. DO NOT use the component button. It will fail you.

6. Now, create a php file. Use whatever editor you want.

7. If html tags are already in the editor, remove them. We want it to be blank.

8. Enter the following into the php file:
Code:
<?php
$name = $_POST['name'];
$subject = $_POST['subject'];
$message = $_POST['message'];

mail("ruiqim@gmail.com", $subject . "--" . $name, $message);
?>


9. Change all that to whatever you need. For example, change the email to your email. And add or remove variables dependent on how many fields you have in your Flash file. Change the stuff in $_POST['stuff'] to whatever your variable for your input name is.

10. Save the php file to "contact.php".

11. Now go back to your flash file. In the submit button's code, it should say the following:
Code:
on(release) {
form.loadvariables("contact.php");
}


12. In form's code, it should say the following:
Code:

onClipEvent(data) {
_root.nextFrame();
}


13. Make a new frame. Add stuff to it so that it tells the user that the message was sent successfully. I recommend creating a back button, too.

14. Add stop(); to both frames.

15. You're done. You just need to save both the Flash file and the Php file to the same directory.


Here's an example from my website:
http://raidation.frih.org/contact.html
Mrbean
thanks good turtorial
Related topics

Need help to make my Flash contact form functioning!
Contact form or email address?
Sending mail with flash using PHP
I am trying to build a contact form using php and flash
Need a Contact form from HTML/PHP

contact form
Need a simple Contact form
For those who need a contact form
AJAX and PHP contact form
Contact Form prob

How do I set up an email account in Thunderbird
contact form with IP feature ?
How to create flash websites?
mail()
Easy Contact Form with Instructions
Reply to topic    Frihost Forum Index -> Miscellaneous -> Tutorials

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.