Flash Form through PHP

I am creating a flash form using PHP by following this tutorial…

http://www.kirupa.com/developer/actionscript/flash_php_email.htm

I want few more things…in the body of the mail like phone, address. Please tell me what changes in PHP file will allow me to do this?

please help guys…tell me the changes required at add more fields.

$headers .= "Phone: " . $_POST["phone"] . "
";
$headers .= "Address: " . $_POST["address"] . "
";

a break down^

. is the same as + in ActionScript

$_POST is the variable name the script is expecting.

"
" basically returns the line and starts a new line ( same effect as <br> )

make sure you enter “phone” and “address” into the var area of your respective dynamic text boxes

hope this helps…

:yoshi:

I add those lines in PHP and also add var name in flash file…but still forwarding only a message. Please check…

Please someone can help…

show the as code & php code you are using and also what values do you have on your contact form other than messages?

This is the PHP code…in which i have added Phone and Company variable.

<?php
/***************************************************\
 * PHP 4.1.0+ version of email script. For more
 * information on the mail() function for PHP, see
 * http://www.php.net/manual/en/function.mail.php
\***************************************************/


// First, set up some variables to serve you in
// getting an email.  This includes the email this is
// sent to (yours) and what the subject of this email
// should be.  It's a good idea to choose your own
// subject instead of allowing the user to.  This will
// help prevent spam filters from snatching this email
// out from under your nose when something unusual is put.

$sendTo = "xyz@abc.com";
$subject = "Mail from me";

// variables are sent to this PHP page through
// the POST method.  $_POST is a global associative array
// of variables passed through this method.  From that, we
// can get the values sent to this page from Flash and
// assign them to appropriate variables which can be used
// in the PHP mail() function.


// header information not including sendTo and Subject
// these all go in one variable.  First, include From:
$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">
";
// next include a replyto
$headers .= "Reply-To: " . $_POST["email"] . "
";
// often email servers won't allow emails to be sent to
// domains other than their own.  The return path here will
// often lift that restriction so, for instance, you could send
// email to a hotmail account. (hosting provider settings may vary)
// technically bounced email is supposed to go to the return-path email
$headers .= "Return-path: " . $_POST["email"];


// now we can add the content of the message to a body variable
$headers .= "Phone: " . $_POST["phone"] . "
"; 
$headers .= "Company: " . $_POST["company"] . "
"; 
$message = $_POST["message"];


// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $message, $headers);

?>

And i like to mention a problem again…that only mailing a message. And i need Phone, company, and name/email too if possible in the message body.

Well someone will reply to my problem…i need urgent help.

<?php 
/***************************************************\ 
* PHP 4.1.0+ version of email script. For more 
* information on the mail() function for PHP, see 
* http://www.php.net/manual/en/function.mail.php 
\***************************************************/ 


// First, set up some variables to serve you in 
// getting an email.  This includes the email this is 
// sent to (yours) and what the subject of this email 
// should be.  It's a good idea to choose your own 
// subject instead of allowing the user to.  This will 
// help prevent spam filters from snatching this email 
// out from under your nose when something unusual is put. 

$sendTo = "xyz@abc.com"; 
$subject = "Mail from me"; 

// variables are sent to this PHP page through 
// the POST method.  $_POST is a global associative array 
// of variables passed through this method.  From that, we 
// can get the values sent to this page from Flash and 
// assign them to appropriate variables which can be used 
// in the PHP mail() function. 


// header information not including sendTo and Subject 
// these all go in one variable.  First, include From: 
$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">
"; 
// next include a replyto 
$headers .= "Reply-To: " . $_POST["email"] . "
"; 
// often email servers won't allow emails to be sent to 
// domains other than their own.  The return path here will 
// often lift that restriction so, for instance, you could send 
// email to a hotmail account. (hosting provider settings may vary) 
// technically bounced email is supposed to go to the return-path email 
$headers .= "Return-path: " . $_POST["email"]; 


// now we can add the content of the message to a body variable 
$headers .= "Phone: " . $_POST["phone"] . "
"; 
$headers .= "Company: " . $_POST["company"] . "
"; 
$message = "Phone: ".$_POST['phone']."/r Company: ".$_POST['company']."/r".$_POST["message"]; 


// once the variables have been defined, they can be included 
// in the mail function call which will send you an email 
mail($sendTo, $subject, $message, $headers); 

?>

Thanks this is working…

Please tell me one more thing…

**If I want to clear a form textboxes in the movieclip…by clicking clear button…then what will be the code. I tried…

_root.mc1.text = “”**

but this not works.