PHP + AS3 contact form problem

Hello there. I have designed a contact form in Flash CS4, in conjunction with a PHP file, which should send the required data fields to an email address. When I test the SWF file containing the form, the form loads perfectly, but the instant I click on the ‘Send’ button, the status text ‘Sending …’ appears, and stays there for ever. In addition I get the following error message:

[COLOR=blue]Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables()
at flash.net::URLLoader/onComplete()[/COLOR]

Here is my PHP file (contact.php, UTF-8 encoding)

<?php

$sendto = [email protected];
$subject = ‘Laser Tokyo 2009 Registration Form’

$name = $_POST[‘fromname’];
$address1 = $_POST[‘fromaddress1’];
$address2 = $_POST[‘fromaddress2’];
$address3 = $_POST[‘fromaddress3’];
$address4 = $_POST[‘fromaddress4’];
$city = $_POST[‘fromcity’];
$state = $_POST[‘fromstate’];
$country = $_POST[‘fromcountry’];
$postcode = $_POST[‘frompostcode’];
$email = $_POST[‘fromemail’];
$number = $_POST[‘attendeenumber’];
$regfee = $_POST[‘regfeeeach’];
$feetotal = $_POST[‘regfeetotal’];
$ccname = $_POST[‘cardname’];
$cctype = $_POST[‘cardtype’];
$ccno = $_POST[‘cardnumber’];
$ccexpire = $_POST[‘cardexpire’];
$ccsecno = $_POST[‘cardsecuritynumber’];
$comewith = $_POST[‘accompanypersons’];

$content = "Name: " . $name . "

";
$content .= "Address_1: " . $address1 . "
";
$content .= "Address_2: " . $address2 . "
";
$content .= "Address_3: " . $address3;
$content .= "Address_4: " . $address4 . "

";
$content .= "City: " . $city . "
";
$content .= "State: " . $state . "
";
$content .= "Country: " . $country . "
";
$content .= "Post_Code: " . $postcode . "

";
$content .= "Email: " . $email . "

";
$content .= "Reg_Persons: " . $number . "
";
$content .= "Reg_Fee_Each: " . $regfee . "
";
$content .= "Reg_Fee_Total: " . $regfeetotal . "
";
$content .= "Reg_Fee_each: " . $regfee . "

";
$content .= "Card_Name: " . $ccname . "
";
$content .= "Card_Type: " . $cctype . "
";
$content .= "Card_Number: " . $ccno . "
";
$content .= "Card_Expires: " . $ccexpire . "
";
$content .= "Card_Security_Number: " . $ccsecno . "

";
$content .= “Accompanying_Persons” . $comewith . "
";

if(mail($sendto,$subject,$content))
{
echo ‘response=passed’;
}
else
{
echo ‘response=failed’;
}
?>

and here is my AS3 code

send_btn.addEventListener(MouseEvent.CLICK, submit);
function submit(e:MouseEvent):void
{
var variables:URLVariables = new URLVariables();
variables.fromname = name_txt.text;
variables.fromaddress1 = address1_txt.text;
variables.fromaddress2 = address2_txt.text;
variables.fromaddress3 = address3_txt.text;
variables.fromaddress4 = address4_txt.text;
variables.fromcity = city_txt.text;
variables.fromstate = state_txt.text;
variables.fromcountry = country_txt.text;
variables.frompostcode = postCode_txt.text;
variables.fromemail = email_txt.text;
variables.attendeenumber = regPersons_txt.text;
variables.regfeeeach = regFee_txt.text;
variables.regfeetotal = regTotal_txt.text;
variables.cardname = ccName_txt.text;
variables.cardtype = ccType_txt.text;
variables.cardnumber = ccNumber_txt.text;
variables.cardexpire = ccExpire_txt.text;
variables.cardsecuritynumber = ccSecure_txt.text;
variables.accompanypersons = accompany_txt.text;

var req:URLRequest = new URLRequest(“http://www.rgcbiomedical.com/LT2009/contact.php”);
req.data = variables;
req.method = URLRequestMethod.POST;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, sent);
loader.addEventListener(IOErrorEvent.IO_ERROR, error);
loader.load(req);
status_txt.text = “Sending…”;
}
function sent(e:Event):void
{
status_txt.text = “Your email has been sent.”;
name_txt.text = address1_txt.text = address2_txt.text = address3_txt.text = address4_txt.text
= city_txt.text = state_txt.text = country_txt.text = postCode_txt.text = email_txt.text
= regPersons_txt.text = regFee_txt.text = regTotal_txt.text = ccName_txt.text = ccType_txt.text = ccNumber_txt.text
= ccExpire_txt.text = ccSecure_txt.text = accompany_txt.text = “”;
}
function error(e:IOErrorEvent):void
{
status_txt.text = “There was an error. Please try again later.”;
}

I have been through the coding of both the PHP and AS3 with a fine tooth comb. Let me say here I am an absolute novice at PHP, and picking my way gradually through the AS3 minefield. Both sets of code were adapted from a tutorial which I followed assiduously and which worked (although there were fewer fields), so I am at a loss as to why I am getting the above error message (#2101) when I test the SWF file containing the form, although it must be in my coding somewhere. I did check with the company hosting the website to make sure they were PHP compliant, and they are.
When I try sending the form actually online, after clicking on the Send button the ‘Sending …’ status appears but never moves on to either the sent or the error messages. What little hair I have is fast disappearing in clumps. Any help would be greatly appreciated.