# Flash variables to PHP problem

**URL:** <https://forum.kirupa.com/t/flash-variables-to-php-problem/236455>\
**Category:** flash\
**Created:** [August 21, 2007, 1:50am UTC](https://forum.kirupa.com/t/flash-variables-to-php-problem/236455 "2007-08-21T01:50:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smokefree](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@smokefree](https://forum.kirupa.com/u/smokefree)\
**Post date:** [August 21, 2007, 1:50am UTC](https://forum.kirupa.com/t/flash-variables-to-php-problem/236455/1 "2007-08-21T01:50:41Z")

</div>

I have a flash page with a form and several variables I want emailed to me via PHP.

It all works except I receive variables in 2 different emails! The first has name, email etc variables, the second has answer variables from an animated questionnaire.

\*\* How do I get all the variables from the page passing to email.php and sending to me in the 1 file? \*\* Any help is greatly appreciated.

- All the files are here: [http://www.clickview.com.au/richard\_dev/survey.zip](http://www.clickview.com.au/richard_dev/survey.zip)
- A demo is here: [http://www.clickview.com.au/richard\_dev/survey\_questions10.html](http://www.clickview.com.au/richard_dev/survey_questions10.html)

The Flash Code:

true\_btn.onPress = function(){loadVariablesNum(“email.php”, 0, “POST”);  
// This sends the % answers to email.php (value of 10 hardcoded for ‘maths\_answer’ for testing)

form.loadVariables(“email.php”, “POST”);  
// This sends the textfield answers (name, email, school)

If I comment out either line, I get the % or textfield answers mailing to me no problem.  
With both lines at once though, email.php sends me 2 emails - one with %s and other with textfield answers (have to click submit twice though!).

Code for email.php:

\<?php

$sendTo = "test@test.com";  
$subject = “Survey Response”;

$headers = “From: " . $\_POST[“name”] .” “. “\<” . $\_POST[“email”] .”\>  
";

$headers .= "Reply-To: " . $\_POST[“email”] . "  
";

$headers .= "Return-path: " . $\_POST[“email”];

$message = "name is " . $\_POST[“name”] . "  
" . "email is " . $\_POST[“email”] . "  
" . "school is " . $\_POST[“school”] . "  
" . "maths answer is " . $\_POST[“maths\_answer”] . "  
" . "science answer is " . $\_POST[“science\_answer”] . "  
" . "english answer is " . $\_POST[“english\_answer”] . "  
" . "humanities answer is " . $\_POST[“humanities\_answer”] . "  
" . "health answer is " . $\_POST[“health\_answer”];

mail($sendTo, $subject, $message, $headers);

?\>
