Flash from problem

I have made a form…

and on the submit button i added this code:
on (release) {
if (name eq “” || contact eq “” || title eq “” || message eq “” ) {
info = “Please fill in all fields”;
stop();
} else {
loadVariablesNum(“send.php”, 0, “POST”);
nextFrame();
name = “”;
contact = “”;
title = “”;
message = “”;
info = “”;
}
}

The send.php file is like:
<?
$headers = “From: $name”;
mail("dh@designers-hub.com", “$headers”, “$title”, “$contact”, “$message”);
?>

For some reason when it sends it doesn;t send the $message…

Can you fix this or do you know a better code?

Check to see if you gave your message text box the correct variable name.

There are some errors in your PHP file. You’re trying to use a variable like this “$headers”. That won’t use the value of the variable $headers, it will use the string “$headers”. So get rid of the quotes around your variable names.

Same thing for

$headers = "From: $name"

, which should be

$headers = "From : ".$name

. You might also want to have it jump to the next line, using “
”.


<? 
$headers = "From: ".$name."
"; 
mail("dh@designers-hub.com", $headers, $title, $contact, $message); 
?>

I hope that’s not your entire scipt …

v-

$name = "Voetsjoeba";
echo "My name is $name.";

prints My name is Voetsjoeba :slight_smile:

You got the order of the arguments messed up… try this

$name = $_POST['name'];
$contact = $_POST['contact'];
$title = $_POST['title'];
$message = $_POST['message'];

$headers = "From: $name <$contact>";

mail("dh@designers-hub.com", $title, $message, $headers);

as I discussed with you in MSN, that’s legal voets…

and you need to check whether REGISTER_GLOBALS is on… that script won’t work if it is.

change loadVariablesNum(“send.php”, 0, “POST”); , to getURL(“send.php”, “_blank”, “POST”); , and tell me what the output is.

Lol, I’m such a dummy in PHP :stuck_out_tongue: Sorry guys.