PDA

View Full Version : What's Wrong With My Code!? :(


diggz
03-22-2004, 08:28 AM
I am using the following php in a file named mail.php to process information from an online form,

<?

$to="name@domain.com";
$name="topic of reference";
$subject ="form";

$ADVERT REFERENCE = $_POST["adreference"];
$customer name = $_POST["username"];
$company name = $_POST["companyname"];
$company tel = $_POST["companytel"];
$email address = $_POST["emailaddress"];
$publication name = $_POST["pubname"];
$ad size hxw = $_POST["size"];
$publication deadline = $_POST["deadline"];
$publication contact = $_POST["contactname"];
$contact tel = $_POST["contacttel"];
$delivery address = $_POST["PubAddress"];
$dealership name = $_POST["dealname"];
$dealership address = $_POST["dealadd"];
$dealership telephone = $_POST["dealtel"];
$dealership fax = $_POST["dealfax"];
$dealership email = $_POST["dealemail"];
$dealership website = $_POST["dealweb"];
$additional text = $_POST["addtext"];

$body = "$ADVERT REFERENCE \n $customer name \n $company name \n $company tel \n $email address \n $publication name \n $ad size hxw \n $publication deadline \n $publication contact \n $contact tel \n $delivery address \n $dealership name \n $dealership address \n $dealership telephone \n $dealership fax \n $dealership website \n $additional text \n";
mail($to,$subject,$body);
?>

And this is the code on the flash send button:

on (release) {
if (FirstName.length!=0) {
loadVariablesNum("http://www.domain.com/folder/mail.php", "0", "POST");
gotoAndPlay(10);
}
}

Why won't it actually send the info? where have I gone wrong? please help!

splict
03-22-2004, 12:12 PM
well, off hand i see you have a couple of mistakes. your 0 in loadVariablesNum should not be in quotes. Also, variables are one word. Try $ADVERT_REFERENCE instead of $ADVERT REFERENCE on all your two word variables. In addition, uppercase variables are usually reserved for constants. While this has no effect on their functionality in php it is best for clarity. Use: $advertReference or $advert_reference

If it still doesn't work, try visiting your webpage (mail.php). In the case of the above code it would have errored out and you would have seen the line number of the first error. If it sends the mail then the problem is in flash.

-splict