# Flash form works BUT is opening the \*.php file

**URL:** <https://forum.kirupa.com/t/flash-form-works-but-is-opening-the-php-file/212625>\
**Category:** Uncategorized\
**Created:** [January 12, 2007, 4:53pm UTC](https://forum.kirupa.com/t/flash-form-works-but-is-opening-the-php-file/212625 "2007-01-12T16:53:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alapimba](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@alapimba](https://forum.kirupa.com/u/alapimba)\
**Post date:** [January 12, 2007, 4:53pm UTC](https://forum.kirupa.com/t/flash-form-works-but-is-opening-the-php-file/212625/1 "2007-01-12T16:53:27Z")

</div>

Hello  
I have my form working one way but it opens the \*.php file.  
If i use another method it don’t open the \*.php but don’t send the radio button value.

Here is my code:

```auto
participar.clickHandler = function() {
 doSubmit();
}
function doSubmit()
{
 if(!form.nome.length){
  trace("enter nome");
  _root.quiz.form.sendStatus.text = "Preencha os campos em branco";
 }else if(!form.email.length){
  trace("enter email");
  _root.quiz.form.sendStatus.text = "Preencha os campos em branco";
 }else if(!form.morada.length){
  trace("enter morada");
  _root.quiz.form.sendStatus.text = "Preencha os campos em branco";
 }else if(!form.codigo.length){
  trace("enter codigo");
  _root.quiz.form.sendStatus.text = "Preencha os campos em branco";
 }else if(!form.telefone.length){
  trace("enter telefone");
  _root.quiz.form.sendStatus.text = "Preencha os campos em branco";
 }else{
 _root.quiz.form.sendStatus.text = "Aguarde por favor";
 userData.respostas = respostas.getValue();
 _root.quiz.form.loadVariables("quiz.php", "POST");
 }
}
/* this code works but open the page quiz.php
{
userData = new LoadVars();
userData.nome = nome;
userData.morada = morada;
userData.codigo = codigo;
userData.telefone = telefone;
userData.email = email;
userData.respostas = respostas.getValue();
userData.send("quiz.php", "", "post");
}
*/

```

the code that don’t send the radio button value returns this:  
[object Object]

my php code is:

```php
<?php
$sendTo = "bla@bla.com";
$subject = "quiz";
$headers = "From: " . $_POST["nome"];
$headers .= "<" . $_POST["email"] .">
";
$headers .= "Reply-To: " . $_POST["email"];
$message = $_POST["nome"] ."
";
$message.= $_POST["morada"] ."
";
$message.= $_POST["codigo"] ."
";
$message.= $_POST["telefone"] ."
";
$message.= $_POST["email"] ."
";
$message.= $_POST["respostas"] ."
";
mail($sendTo, $subject, $message, $headers);
?>

```

What i’m doing wrong and how to fix it?
