Home > Regular flash template help > Flash/php contact form installation

Flash/php contact form installation

1. To get the flash conatct form, please CLICK HERE to download. After unraring the file, please follow the below instructions.

Installing the contact form

The contact form will help you recieving messages directly from your site. The message is sent by a PHP script so you will need PHP support on your hosting server.

1. Unzip / Unrar the contact form archive. You will find 3 files :
* contact_form.fla - the contact form source file
* email.php - the PHP file which will send the message
* contact_form.swf - the standard contact form
The standard contact form has 3 fields : Name, E-mail, Comments and the send button:
2. Copy those 3 files into your site folder.
3. Edit your site in Macromedia Flash MX or Macromedia Flash MX 2004.
4. Go in the timeline on the contact keyframe.
5. Insert a new empty movie clip : Insert -> New Symbol -> Movie clip. You can name it "contact form".
6. Open the Flash Library ( CTRL+L or Window -> Library ) and drag the "contact form" movie clip symbol into the timeline contact keyframe.
7. Name the "contact form" movie clip symbol : "contact_form"
8. On the timeline click the contact keyframe, open the actions tab ( F9 ) and place the following actions: _root.contact_form.loadMovie("contact_form.swf");

Now when you will export your movie the contact form will load into the contact keyframe. 9. Now you will have to insert the email address where the messages will arrive. For this you will have to edit the second line :
<< $destination="email@domain_name.com"; >>. You have to change "email@domain_name.com" with your email.
Now the contact form will work and the messages will arrive on your email address.
Contact Form Customization The standard contact form has only 3 input text fields, but you can add more fields. Adding a new text field :
1. Open in Macromedia Flash contact_form.fla
2. Open the Flash Library ( CTRL+L or Window -> Library ) and edit the "form" movie clip symbol.
3. Select the Text Tool (T), from the Properties panel select Input text and draw your new text field..
4. Also in the Properties panel there is the "Var" property where you must enter the name for your new text. Let's name it "new_text_field".
5. Edit the "email.php" file. Right click the file and select : Open With -> Notepad . For the new texfield you must add new lines in the PHP script: and the standard script will be now like this:

< ?
$destination="email@domain.com";

$new_text=$_POST['new_text_field'];

$name=$_POST['name'];
$email=$_POST['email'];
$mes=$_POST['comments'];
$subject="Message from $name" ;
$mes="Name : $name\n
Email: $email\n
Comments: $mes\n

New text field : $new_text";

mail($destination,$subject,$mes);

? >
Now the new text field will work.