Hi,
I am trying to get the results of what has been typed into a form emailed to me via a PHP script.
The form comes at the end of a multi frame movie & contains “Input Text Fields” & a “Check Box” component. The text boxes are each linked to a variable that was instigated at author time through the property panel, the check box instance is named “myCheckBox”
This is the script I have for the form page, I’m using the loadVars object.
_root.sub_btn.onRelease=function(){
lv=new LoadVars();
lv.name =name;
lv.sur=sur;
lv.email =email;
lv.cheq=myCheckBox.getValue();
lv.feedback=message;
lv.send("[http://ccgi.jdwyer.plus.com/cgi-bin/memail.php","POST](http://ccgi.jdwyer.plus.com/cgi-bin/memail.php)");
}
The code seems to work, as when I look at the address bar for the PHP script – the variables are in encoded name-value pairs.
I know the PHP code works as I have used it from an HTML generated form with no problems. Here is the PHP code:
<?php
//create short variable names
$name=$HTTP_POST_VARS['name'];
$sur=$HTTP_POST_VARS['sur'];
$email=$HTTP_POST_VARS['email'];
$cheq=$HTTP_POST_VARS['cheq'];
$feedback=$HTTP_POST_VARS['feedback'];
$toaddress = 'jdwyer@jdwyer.plus.com';
$subject = 'Feedback from web site';
$mailcontent = 'Customer name: '.$name."
"
.Customer surname: '.$sur."
"
.'Customer email: '.$email."
"
.Check box: '.$cheq."
"
."Customer comments:
".$feedback."
";
$fromaddress = 'From: webserver@example.com';
mail($toaddress, $subject, $mailcontent, $fromaddress);
?>
Currently all I’m getting is the email with just the categories shown – no variables make it across to populate the categories.