# FLASH & PHP contact form issues (AS 2.0)

**URL:** <https://forum.kirupa.com/t/flash-php-contact-form-issues-as-2-0/245474>\
**Category:** flash\
**Created:** [November 30, 2007, 1:38am UTC](https://forum.kirupa.com/t/flash-php-contact-form-issues-as-2-0/245474 "2007-11-30T01:38:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgil](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@tgil](https://forum.kirupa.com/u/tgil)\
**Post date:** [November 30, 2007, 1:38am UTC](https://forum.kirupa.com/t/flash-php-contact-form-issues-as-2-0/245474/1 "2007-11-30T01:38:47Z")

</div>

Can anyone help me figure out how to add a second message box to the code below.

This is a Flash contact form that uses PHP to send an email. The form works fine, but I’ve been trying to figure out the code to add a SECOND message to my email.

Currently when I run and fill out the form, I get the email, subject and message, but I want to add a second message field, let’s call it message2.

Here is the Flash and PHP code:

//////------Flash AS 2.0------------////////

stop();  
send\_btn.onRelease = function() {  
my\_vars = new LoadVars();  
my\_vars.sender = email\_box.text;  
my\_vars.subject = subject\_box.text;  
my\_vars.message = message\_box.text;

```
if (my_vars.sender != "" and my_vars.subject != "" and my_vars.message != "") {
	my_vars.sendAndLoad("mailer.php", my_vars, "POST");
	gotoAndStop(2);
} else {
	error_clip.gotoAndPlay(2);
}
my_vars.onLoad = function() {
	gotoAndStop(3);
};

```

};  
email\_box.onSetFocus = subject\_box.onSetFocus = message\_box.onSetFocus = function () {  
if (error\_clip.\_currentframe != 1) {  
error\_clip.gotoAndPlay(6);  
}  
};

//////------PHP code------------////////

\<?php

// read the variables form the string, (this is not needed with some servers).  
$subject = $\_REQUEST[“subject”];  
$message = $\_REQUEST[“message”];  
$sender = $\_REQUEST[“sender”];

// include sender IP in the message.  
$full\_message = $\_SERVER[‘REMOTE\_ADDR’] . "

" . $message;  
$message= $full\_message;

// remove the backslashes that normally appears when entering " or ’  
$message = stripslashes($message);  
$subject = stripslashes($subject);  
$sender = stripslashes($sender);

// add a prefix in the subject line so that you know the email was sent by online form  
$subject = “web visitor:”.’ '.$subject;

// send the email, make sure you replace [email@yourserver.com](mailto:email@yourserver.com) with your email address  
if(isset($message) and isset($subject) and isset($sender)){  
mail("you@yourdomain.com", $subject, $message, “From: $sender”);  
}  
?\>
